我找不到一個 git 命令,我可以在其中正確獲取提交中重命名檔案的差異。假設我們看一下 repo pypa/pipenv和 commit d0423ac8a0bdf3454f165eb9871f7b9327f390cb。如果我們在克隆的 repo 上運行以下命令:
git diff --stat d0423ac8a0bdf3454f165eb9871f7b9327f390cb~1 d0423ac8a0bdf3454f165eb9871f7b9327f390cb可以看到檔案linux.py被重命名為_proc.py
不幸的是,當我運行git show d0423ac8a0bdf3454f165eb9871f7b9327f390cb -- pipenv/vendor/shellingham/posix/_proc.py 重命名的檔案時,它會被視為一個新檔案,并且看不到真正的更改。
uj5u.com熱心網友回復:
嘗試命名這兩個檔案:
git show d0423ac8 -- pipenv/vendor/shellingham/posix/linux.py pipenv/vendor/shellingham/posix/_proc.py
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/527924.html
標籤:混帐githubgit 提交
下一篇:為什么GitHub看不到差異?
