How can I tell what svn version my git-svn repository is based on?

喜欢而已 提交于 2019-12-12 16:34:13

问题


I've cloned an SVN repository into git using git-svn, but I'm having trouble rebasing and I thought to work around it by using svn to generate a patch between the old SVN revision I'd used to clone my git repo in the first place and the current version. That way I could just apply the patch and call it rebased.

Any idea how I can find the SVN revision number my current git-svn clone is based on?


回答1:


If you do git log you should be able to see a history of all commits in your repository. The first of these will correspond to the SVN revision that your git repository was cloned from.

So, you might see something like this:

commit e3223a9f72fa80b16dbe1a471c73657a4cacee3d
Author: joe <joe@31875c6e-e9e7-0310-b337-c57ebf30f660>
Date:   Tue Feb 22 14:30:26 2011 +0000

PO-310: Commit message here

git-svn-id: https://svn.myrepo.com/development/trunk@51174 31875c6e-e9e7-0310-b337-c57ebf30f660

In this instance, you can see that I have cloned from revision 51174 of the remote SVN repo (fake paths and names used here)

You can simplify the output from git log by using the --skip=<number> option (e.g. git log --skip=100, though this requires you to have some idea of the number of commits since you initially cloned the repository.




回答2:


git svn find-rev git-svn will print what you want.



来源:https://stackoverflow.com/questions/7154244/how-can-i-tell-what-svn-version-my-git-svn-repository-is-based-on

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!