1.Your branch is ahead of 'origin/master' by 2 commits
当本地提交时不是基于最新的代码地址,提交又rebase成功时,本地git pull会提示如上,可以使用下面的指令将本地指向最新的代码
git stash
git pull --rebase
git stash pop
2.撤销add操作
git reset HEAD
本文介绍了在Git中遇到本地分支领先于远程master分支时如何通过git stash和git pull --rebase进行同步,并详细讲解了如何撤销已执行的add操作。这些技巧对于日常开发中的版本管理和代码提交至关重要。
1.Your branch is ahead of 'origin/master' by 2 commits
当本地提交时不是基于最新的代码地址,提交又rebase成功时,本地git pull会提示如上,可以使用下面的指令将本地指向最新的代码
git stash
git pull --rebase
git stash pop
2.撤销add操作
git reset HEAD
9354
332
123

被折叠的 条评论
为什么被折叠?