You should rebase your local commits on top of the (now updated) remote main
branch, using git rebase
.
cd /path/to/my/local/cloned/repo
git fetch
git rebase origin/main
git push
That way, you are:
- resolving any potential merge conflict locally (during the rebase, which replays your commits on top of
origin/main
)
- are pushing only new commit on top of the most recent version of
origin/main
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…