Hi_im_MrMee6
Hi_im_MrMee6

Reputation: 93

git push rejected, merge conflicts, git pull --rebase

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:

git cli

Upvotes: 9

Views: 2014

Answers (1)

VonC
VonC

Reputation: 1324278

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.

Upvotes: 7

Related Questions