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

Can't push changes to Bitbucket

Gene_M
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 5, 2023

I'm trying to push some minor changes up to Bitbucket with my normal Sourcetree workflow but am getting this error:

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags --set-upstream origin master:dev/gm/AddDefaultStateSequence
Pushing to https://bitbucket.org/Gene_M/cpf_h7a3.git
To https://bitbucket.org/Gene_M/cpf_h7a3.git
= [up to date] pre-rearchitecture-checkpoint -> pre-rearchitecture-checkpoint
! [rejected] master -> dev/gm/AddDefaultStateSequence (non-fast-forward)
error: failed to push some refs to 'https://bitbucket.org/Gene_M/cpf_h7a3.git'

 hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


Completed with errors, see above.

I was able to commit the changes but the push failed.  As far as I can tell I'm using the same process I've always used, but for some reason that I can't figure out, it isn't working this time.  I've tried using git bash and get the same error.  Any suggestions will be greatly appreciated.  Thanks

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 8, 2023

Hey @Gene_M

G'day.

Based on the error message, it looks like your local repository copy is outdated.

This happens when there's a new commit in the branch you are working on the remote repository that you don't have the copy locally. So git rejected your push because of this.

The workaround is to do a git pull to ensure your local repository copy is updated with the latest changes.

Cheers,
Syahrul

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events