Git : Use Git-SVN2022/09/27 |
|
For the case Subversion repositories are used on Server Side,
it's possible to use them from Git working repositories with Git-SVN.
|
|
| [1] | Install Git-SVN on Client Side. |
|
root@node01:~# apt -y install git-svn
|
| [2] | On this example, it is based on that [svnserve] is running on Subversion Server Host. (not mandatory requirements) Also Access to [/var/svn/repos/project] repository on Subversion Server [dlp.srv.world]. |
|
# clone with [git svn ***] from SVN repository jammy@node01:~/work$ git svn clone --username ubuntu svn://dlp.srv.world/repos/project
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /home/jammy/work/project/.git/
Authentication realm: <svn://dlp.srv.world:3690> 483017c4-bf3f-4328-aa78-bd26248e8cca
Password for 'ubuntu':
W: +empty_dir: trunk
r1 = 881c7904e8d28647e19f6bfd4611841a9566ae1c (refs/remotes/git-svn)
W: +empty_dir: branches
r2 = c4097cabf1bdf0e6e2075ca035cee75868fc225d (refs/remotes/git-svn)
W: +empty_dir: tags
r3 = f259f83b94b3c3acc55a8f27f206b578a751d048 (refs/remotes/git-svn)
A trunk/index.html
r4 = 9bdd1c1160be0152a2df114d85c324a1fe69541f (refs/remotes/git-svn)
M trunk/index.html
r5 = f0430c1ea8f90d4315f9574146ede2628dbc439b (refs/remotes/git-svn)
Checked out HEAD:
svn://dlp.srv.world/repos/project r5
creating empty directory: branches
creating empty directory: tags
jammy@node01:~/work$ total 12 drwxrwxr-x 3 jammy jammy 4096 Sep 27 02:04 ./ drwxr-x--- 5 jammy jammy 4096 Sep 27 02:02 ../ drwxrwxr-x 6 jammy jammy 4096 Sep 27 02:04 project/jammy@node01:~/work$ cd project/trunk jammy@node01:~/work/project/trunk$ total 12 drwxrwxr-x 2 jammy jammy 4096 Sep 27 02:07 ./ drwxrwxr-x 6 jammy jammy 4096 Sep 27 02:04 ../ -rw-rw-r-- 1 jammy jammy 22 Sep 27 02:04 index.html # [commit] updated file jammy@node01:~/work/project/trunk$ echo "test file" >> index.html jammy@node01:~/work/project/trunk$ git commit index.html -m "update" [master 447961a] update 1 file changed, 1 insertion(+) # to [push], specify [dcommit] jammy@node01:~/work/project/trunk$ git svn dcommit
Committing to svn://dlp.srv.world/repos/project ...
Authentication realm: <svn://dlp.srv.world:3690> 483017c4-bf3f-4328-aa78-bd26248e8cca
Password for 'ubuntu':
M trunk/index.html
Committed r6
M trunk/index.html
r6 = c5b14889dd8ccab6c508c1d479e9da5e642f13f9 (refs/remotes/git-svn)
No changes between a721466bfdd0fe5afed0f021fde79528b19ae5a9 and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
# to merge the latest updates by others to your local working repository, specify [rebase] jammy@node01:~/work/project/trunk$ git svn rebase
M trunk/index.html
r7 = 5409bba49db298910223e7dcb8dafcad0932e3b6 (refs/remotes/git-svn)
Successfully rebased and updated refs/heads/master.
|
| Sponsored Link |
|
|