I've been trying to figure this one out by reading the git-svn man-page but am having trouble understanding how to achieve it.
What I want to do is:
How do I achieve this?
Suggested workflow for git-svn:
git-svn
mentioned above. master
. DO NOT WORK DIRECTLY ON THIS BRANCH. git checkout -b <feature>
from master). git rebase master
in your feature branch. 5a. If you want to pull in svn updates at this time, then switch to master and do git svn rebase
. Then switch back to feature branch, do git rebase master
. git merge <feature>
. git svn dcommit
to push changes to svn. Remember, once you do git svn dcommit
all your changes will become visible to others. So be absolutely sure you have done things properly before doing git svn dcommit
.
You want to use git-svn. I'm not sure what the state of available tutorials is, but here's some stuff to get you started.
Creating your local git repo.
How to git-svn clone the last n revisions from a Subversion repository?
To fetch new revisions from svn use git svn fetch
. This will fetch new revisions and put them on a remote branch. You can make whatever changes you want on your own branch, then commit using git svn dcommit
.
But, I would be careful with the git merge
command. When using git-svn I always recommend using rebase, and making your history strictly linear. svn can't track git branches very well. If you have a branched history in git and try to push that to svn, svn will only be able to represent one half of that history. You won't lose any code, but you will lose granularity of your commits.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.