Migrating from Subversion to Git how can I find a commit given a revision number?

后端 未结 2 1375
灰色年华
灰色年华 2021-02-14 00:23

Migrating from Subversion to Git using svn2git (which internally uses git-svn) I\'d like to know how I can find a specific revision commit.

It is quite common to have is

相关标签:
2条回答
  • 2021-02-14 00:44

    Given the revision number, you can find the Git SHA with

    git svn find-rev r1938
    

    I don't know if there's a "one-shot" way to get the commit or anything, but you can write something like

    git log -p `git svn find-rev r1938`
    

    Update: note that you can also grab the commit message with

    git svn log -r 1938
    

    Update again: note that find-rev also works in reverse:

    git svn find-rev c7443021942
    

    returns the SVN commit number.

    0 讨论(0)
  • 2021-02-14 00:47

    With Git it’s similar:

    Fixed in d8602bb9729ddb2f28e61028cc5981cb310231a2.
    

    Get the diff with:

    git show d8602bb9729ddb2f28e61028cc5981cb310231a2
    
    0 讨论(0)
提交回复
热议问题