Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to resolve issue while attempting to pull

Tony Ho _Vinova_ November 21, 2022

Can anybody help me to check this issue when try to pull. Thank you so much!

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch --no-tags origin

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks pull origin feature/kwa-417
From https://gitlab.com/myproject/backend
* branch feature/k-417 -> FETCH_HEAD

fatal: Not possible to fast-forward, aborting.
Completed with errors, see above.

1 answer

0 votes
Erez Maadani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2022

Hey @Tony Ho _Vinova_ 

git pull is actually git fetch and git merge.

As you can see above, git fetch is working fine so the failing step is the merge from your local copy of your remote branch into your local branch.

The error you get is that it's not possible to do fast-forward, which probably means that you have local changes/commits which were not pushed to the remote branch. The command `git status` will help you to get more info.

If you need to keep your local changes, the most common option to resolve this kind of issues, is to use explicit merge strategy, and not the only-fast-forward strategy. Have a look here: https://www.atlassian.com/git/tutorials/using-branches/merge-strategy for more info.

Another option would be to:

  • Move your local changes/commit to a different branch.
  • Reset your local branch back to the last common commit with your remote branch
  • Merge the changes from your remote branch
  • Re-apply the changes from the new branch you created on your local branch. 

   

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events