Question

I have updated my view to the latest revision using git svn fetch. Then I realized the recent revisions have corrupted files.

I know the revision number at which my build was successful.

I do not find rev number in git log. So I can not exactly go to specific revision using commit id.

How do I go back to this revision using the revision number (last successful)?

Était-ce utile?

La solution

The git log command shows the Git log, which uses Git-style SHA-1 hashes to identify commits.

If you want to see your Subversion revisions in the log, use git svn log.

You probably want to use the -r option to see your known good commit, and the --show-commit option to show the Git hash that matches up with that commit. Once you identify the Git revision that corresponds to your Subversion revision, you can check it out as you normally would:

$ git svn log -r 100 --show-commit
------------------------------------------------------------------------
r100 | abcd123 | some.guy | 2008-09-05 11:00:31 -0400 (Fri, 05 Sep 2008) | 2 lines

Commit message

------------------------------------------------------------------------
$ git checkout abcd123

And of course, you can retrieve just the files you need from that revision and then commit them as fixed versions:

$ git checkout abcd123 -- some/file.txt
$ git add some/file.txt
$ git commit -m "Revert some/file.txt to uncorrupted version from abcd123"
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top