在實際執行任何操作之前,有什么方法可以顯示 'git cherry-pick ' 將應用的更改嗎?
我希望看到一個“git diff”型別的更改串列,該串列將由命令完成,而無需實際進行更改或修改任何內容。
uj5u.com熱心網友回復:
git cherry-pick沒有--dry-run像其他一些命令那樣的選項。
但是,雖然不完全是您所要求的,但您可以對其進行測驗,回滾將是微不足道的:
# cherry-pick without actually committing
git cherry-pick -n <commit>
# inspect changes
git diff --staged
# wipe all these temporary changes to go back to where you started
git reset --hard
uj5u.com熱心網友回復:
我相信你可以在你的分支上的最后一次提交和你想要挑選的提交之間做一個 git diff 像這樣:
git diff [last-commit-hash] [cherry-pick-commit-hash]
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/354940.html
