开发者

Can I use git-svn and look like I was using SVN, if yes how?

I'm used to git and I like it very much, but one of my client is (still?) using subversion, I don't really now about svn, but I know there a git-svn packa开发者_如何学运维ge.

I know it's possible to fetch a repo from svn with git, but can i use git instead of svn and still commit, and "push" to the central svn server?

I want to use git and not svn if I can can you point me any tutorial to do so?

Thank you

EDIT:

I actually don't care to fetch ALL the commits, only the 10/20 previous one would be enough as the application is in a working state and that's only about doing improvements so I will only fetch all the commit history if it's actually needed.


git-svn provides a bridge from Git and SVN. It will behave like vanilla Git locally, but as soon as you try to push or pull your changes to or from master, it gets completely different.

Instead of doing a push, you will use git commit to commit locally, and git svn dcommit to push your local commits to SVN.

The git-svn documentation explains how to pull from a SVN repository. Note that it is extremely slow (compared to normal git) because it fetches every revision from SVN. See the examples at the bottom of the documentation.

Here it a typical way I've used it:

  1. git svn clone http://svn.example.com/project -T trunk -b branches -t tags - The URL is your SVN repo, and you specify the -T, -b, and -t switches to specify sub paths in your SVN directory. Git will then use these SVN directories to look for branches and tags, and trunk as master.
  2. Make some code changes
  3. git add... to stage your changes
  4. git commit... to commit your changes locally.
  5. git svn dcommit to push the local commits to SVN. For each local commit, Git will make these separate commits on the SVN server.


It is possible but i think the best is that one changes version control app :)

to get the svn commits to git (after you have already git svn initialized it of course)

git svn fetch

To get your git commits to svn

git commit git svn dcommit

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜