当前位置: 动力学知识库 > 问答 > 编程问答 >

git svn - git svn fetch does not fetch a Subversion commit message modified after initial clone

问题描述:

I cloned a large SVN repository (nearly 8,000 commits) and it seems to be OK.

Since then, the commit messages of about 20 Subversion commit messages have been changed to correct a typo. This was done legitimately. However, git svn fetch does not pull the updated commit messages. It still displays the old outdated commit message.

Is there a way to fix this? Preferably in a clean way and without hacking my local git repository too much?

I've tried git svn fetch -r 1234 (where 1234 is a known revision number). But no luck.

网友答案:

from http://git-scm.com/docs/git-svn:

git svn reset

Undoes the effects of fetch back to the specified revision. This allows you to re-fetch an SVN revision.

[...]

Follow reset with a fetch and then git reset or git rebase to move local branches onto the new tree.

So in your case, if revision 1234 is the first one that had its commit message changed, you would do

$ git svn reset -p 1234
$ git svn fetch

If anything is different, including the commit message, then the new commit is a totally different object, with a new SHA1, so as it says, you'll need to rebase any branches you might have onto the appropriate rewritten commit.

分享给朋友:
您可能感兴趣的文章:
随机阅读: