git-svn fetch isn't pulling in the latest versions

后端 未结 4 843
北荒
北荒 2020-12-17 09:07

When I execute a

git svn fetch

from my repository, it returns nothing and doesn\'t update even though there are new commits under svn.

4条回答
  •  無奈伤痛
    2020-12-17 09:39

    git svn fetch only copies new revisions to your local object database, very much like git fetch – both only synchronize object databases. It will not update your branch and working copy. To get the newly fetched changes into your branch, use git svn rebase; it will re-apply all your local changes on top of the latest svn revision.

    git svn rebase will do a fast-forward when there are no local commits, so it should not mess with history. Alternatively you could use git merge --ff-only git-svn to fast-forward to the most recent svn revision (and abort when it is not fast-forwardable, i.e. not a direct descendant)

    You should only use git svn reset when upstream svn has changed history (svndump/svnadmin) and you need to re-fetch the new commits, but this should almost never happen (otherwise blame the admin!)

提交回复
热议问题