开发者

Git-svn operation philosophy?

开发者 https://www.devze.com 2022-12-17 06:54 出处:网络
How does git-svn开发者_运维百科 operate? I have access to an svn repository at work but I\'m going to start to work with a distributed team and I\'d like to start to fire up git use on this project (

How does git-svn开发者_运维百科 operate?

I have access to an svn repository at work but I'm going to start to work with a distributed team and I'd like to start to fire up git use on this project (as a pilot).


Because svn doesn't support the same range and style of branching/merging as git does, you will be limited as to how much of that you can do with the upstream repository. Locally however, it is just a normal git repository, so you can branch and merge and cherry-pick and rebase and everything else your heart desires.

The differences to worry about are interacting with upstream: rather than git pull as you would normally use to update the changes, you'll use git svn rebase, and git will try to replay your local commits onto the remote HEAD, stopping along the way and letting you know about the conflicts you need to resolve, if any (rather than merging them, as is normal with pure git repositories). When you commit, you'll use git svn dcommit, which makes your local commits into a linear history and applies them to the upstream HEAD in svn.


To add to Matt Enright's answer, consider also svn2git (and the reverse script git2svn), in order to get a more git-like repository structure.
(i.e. try to not have the branches as directory, like they are in SVN)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号