Git log -L going forward

后端 未结 1 1666
深忆病人
深忆病人 2021-01-27 03:14

I\'m trying to understand if it is possible to determine how a particular line changes \"in the future\" using git log, i.e., going to an old commit using git

相关标签:
1条回答
  • 2021-01-27 03:43

    First, find out how many tracked development directions (branches) there have been since the specific commit:

    git branch -a --contains b5a3d3f2701bab98318a92eaf781653392494b43
    

    It lists all the branches that contain this commit. For example, there might be origin/foo and origin/bar. These branches are the latest (at the moment the repository is cloned) revision of each direction. Then run

    git log -L 37,37:README.md b5a3d3f2701bab98318a92eaf781653392494b43..origin/foo
    

    to see how Line 37 of README.md has been changed since the specific commit till the latest revision of foo.

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