Git : Use Git-SVN2023/07/25 |
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 bookworm@node01:~/work$ git svn clone --username debian 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/bookworm/work/project/.git/ Authentication realm: <svn://dlp.srv.world:3690> b50b764f-187b-4b0c-a1fe-56b95ca230cd Password for 'debian': W: +empty_dir: trunk r1 = 245779583201736a017677bfb18ca21934f7d61f (refs/remotes/git-svn) W: +empty_dir: branches r2 = 586d61e353ce0e0393b8f237314a26100d01ac49 (refs/remotes/git-svn) W: +empty_dir: tags r3 = 39da1b509612aeb32022e8561bb0dc0d4ad2690b (refs/remotes/git-svn) A trunk/index.html r4 = bb798f58dbb9484617c351e5ee4edf4d25bef2d8 (refs/remotes/git-svn) Checked out HEAD: svn://dlp.srv.world/repos/project r4 creating empty directory: branches creating empty directory: tagsbookworm@node01:~/work$ total 4 drwxr-xr-x 6 bookworm bookworm 4096 Jul 24 21:28 projectbookworm@node01:~/work$ cd project/trunk bookworm@node01:~/work/project/trunk$ total 4 -rw-r--r-- 1 bookworm bookworm 11 Jul 24 21:28 index.html # [commit] updated file bookworm@node01:~/work/project/trunk$ echo "test file" >> index.html bookworm@node01:~/work/project/trunk$ git commit index.html -m "update" [master c397319] update 1 file changed, 1 insertion(+) # to [push], specify [dcommit] bookworm@node01:~/work/project/trunk$ git svn dcommit Committing to svn://dlp.srv.world/repos/project ... M trunk/index.html Committed r5 M trunk/index.html r5 = 9b4a45d5b16ff49761458a6756e618863572ee06 (refs/remotes/git-svn) No changes between c3973193f212ba821a98123a45969dace25c33b6 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] bookworm@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 |
|