How to synchronize two git
i have to use a subversion repository and i'd like to use git-svn. I switch the computer sometimes and at the moment i need to commit my changes and update the other computer. Sometimes the changed code wouldn't work, so my idea would be to create two git-svn repos and synchronize them with push/pull, and sometimes sync them (or one of them) with the svn repository. Would that be possible? Switching the repository to git is no option. (Sadly)
If you need to sync with SVN your Git repo from both of your computer, then yes: each repo will be a "git-svn" one.
You create 2 repos, and then create your own set of git branches on top of the git-svn ones.
But you must not merge/push/pull any branch that will be dcommit'ed back to SVN: You need to pay attention to the CAVEATS section of git-svn:
For the sake of simplicity and interoperating with Subversion, it is recommended that all git svn
users clone
, fetch
and dcommit
directly from the SVN server, and avoid all git clone
/ pull
/ merge
/ push
operations between git repositories and branches. The recommended method of exchanging code between git branches and users is git format-patch and git am, or just 'dcommit'ing to the SVN repository.
Running git merge
or git pull
is NOT recommended on a branch you plan to dcommit
from because Subversion users cannot see any merges you've made. Furthermore, if you merge
or pull
from a git branch that is a mirror of an SVN branch, dcommit
may commit to the wrong branch.
I would say rsync
the two repos across the two machines. You would have the same repo.
上一篇: svn2git失败说作者:VisualSVN服务器没有在./authors.txt文件中定义
下一篇: 如何同步两个git