问题
I'm trying to push my commit, but couldn't since there is another commit (same-level in the HEAD race :)
I know I need to merge those two commits together, not exactly sure how to do it.
I already tried git pull --rebase
.
My GIT-CLI:
回答1:
All you need to need to do is solving the conflict you see mentioned at the end of your pull --rebase
.
See "HOW CONFLICTS ARE PRESENTED": you will have to open those files, and remove the conflict markers.
For the .tern-port
file, you need to decide if you want to keep your file, and remove it, as it has been removed in the upstream repo.
I forgot to configure my
.gitignore
file.
If you realize that because of tracked files that should not be tracked, don't forget to un-track them first, before adding them to your .gitignore
git rm --cached -- afile
echo afile >> .gitignore
git add .gitignore
That can be done during your conflict resolution stage.
Once that stage is done, add them (git add .
), and continue the rebase (git rebase --continue
).
After that, if the git status
is clean, you can push.
来源:https://stackoverflow.com/questions/45205404/git-push-rejected-merge-conflicts-git-pull-rebase