Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Push or Pull in Git

I'm fairly new to using Git, but I do understand the bare basics. However, I have yet to encounter a situation where I have Push/Pull conflicts...until now.

Also, I should point out that the GUI tool I'm using to interact with the Git repository is Atlassian SourceTree (We're using Atlassian Stash to manage our repo's).

Here is the scenario:

I have 2 commits to Push and apparently there are 4 changes that I need to Pull.

When I try to Pull I get this:

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin

git -c diff.mnemonicprefix=false -c core.quotepath=false pull --no-commit origin master
You have not concluded your merge (MERGE_HEAD exists).

Please, commit your changes before you can merge.

Completed with errors, see above.

It says that I need to complete my merge but it's not allowing me to do anything. I don't get a merge list nor is it auto-merging. I can't seem to get past the merge so I can proceed to resolve the Push/Pull conflict.

When I try to Push I get this:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
Pushing to http://[email protected]:XXXX/XXXX/XXXX/XXXXX.git
To http://[email protected]:XXXX/XXXX/XXXX/XXXXX.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'http://[email protected]:XXXX/XXXX/XXXX/XXXXX.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Now how the heck do I resolve this?! Am I going to have to Rebase or something like that?

I was reading about a Fast Forward Push but I have no clue how to do that within this tool. If I have to, I can certainly execute the Git commands from the terminal. I just didn't want to jump into that without consulting someone with with a better understanding of Git and these types of issues.

like image 904
CM-Dev Avatar asked May 21 '26 14:05

CM-Dev


1 Answers

It looks like you're in the middle of a merge(perhaps a previous attempt?)

git merge --abort will cancel that merge, and put you in a state where you can retry the pull and then resolve conflicts.

like image 165
Darren Clark Avatar answered May 26 '26 15:05

Darren Clark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!