Git : Use Git-SVN2026/07/08 |
|
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 ~]# dnf -y install git-svn
|
| [2] | On this example, it is based on that you can access to Subversion Server Host via HTTP. (not mandatory requirements) Also Access to [/var/svn/repos/project] repository on Subversion Server [dlp.srv.world]. |
|
# clone with [git svn ***] from SVN repository [redhat@node01 work2]$ git svn clone --username cent https://dlp.srv.world/project hint: Using 'master' as the name for the initial branch. This default branch name hint: will change to "main" in Git 3.0. To configure the initial branch name hint: to use in all of your new repositories, which will suppress this warning, hint: 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> hint: hint: Disable this message with "git config set advice.defaultBranchName false" Initialized empty Git repository in /home/redhat/work2/project/.git/ Authentication realm: <https://dlp.srv.world:443> DAV SVN Password for 'cent': W: +empty_dir: trunk r1 = 78c3511cd39a262703f1177678bf6f0642b39a3a (refs/remotes/git-svn) W: +empty_dir: branches r2 = b84adae735b8672e69a4ace8c44373b974399f17 (refs/remotes/git-svn) W: +empty_dir: tags r3 = 4f352a7b438887d095f91c3b344a3cfe4930304c (refs/remotes/git-svn) Checked out HEAD: https://dlp.srv.world/project r3 creating empty directory: branches creating empty directory: tags creating empty directory: trunk[redhat@node01 work2]$ total 0 drwxr-xr-x. 3 redhat redhat 18 Jul 8 09:31 project # add a file and [commit] it [redhat@node01 work2]$ cd project/trunk [redhat@node01 trunk]$ echo "test file" >> testfile.txt [redhat@node01 trunk]$ git add testfile.txt [redhat@node01 trunk]$ git commit testfile.txt -m "new testfile.txt" [master 3ad5564] update 1 file changed, 1 insertion(+) create mode 100644 trunk/testfile.txt # to [push], specify [dcommit] [redhat@node01 trunk]$ git svn dcommit
Duplicate specification "id|i=s" for option "i"
Committing to https://dlp.srv.world/project ...
A trunk/testfile.txt
Committed r4
A trunk/testfile.txt
r4 = 12de659697a076a14bb6575bc3c086032494442b (refs/remotes/git-svn)
No changes between 3ad5564c053d006a1451ed33709df7e95c3a9711 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] [redhat@node01 trunk]$ git svn rebase
M trunk/index.html
r7 = 5409bba49db298910223e7dcb8dafcad0932e3b6 (refs/remotes/git-svn)
Successfully rebased and updated refs/heads/master.
|
| Sponsored Link |
|
|