git push origin not working

When I try the command $ git push origin I get the message "Everything up-to-date" but when I check my repository in Bitbucket I see the new verion of the code is not uploaded and there are no cahnges.

Please help me out. I am new to this.

1 answer

1 accepted

Accepted Answer
1 vote

Have you committed your changes before pushing?

Yes I used the below commands:

$ git commit -m "Jul 8 update"
$ git add .
$ git push origin master
I got the message Everything up-to-date

Do git add first and then commit.

Thanks Jobin. I got your point and it worked to some extent. However, on doing the commit I recevied the following messages and it is still not getting pushed to the repository.

gunjan@Niyamgiri:~/tribalrights$ git push origin masterTo ssh://git@bitbucket.org/niyamgiri/tribalrights.git

! [rejected] master -> master (non-fast-forward)

error: failed to push some refs to 'ssh://git@bitbucket.org/niyamgiri/tribalrights.git'

To prevent you from losing history, non-fast-forward updates were rejected

Merge the remote changes (e.g. 'git pull') before pushing again. See the

'Note about fast-forwards' section of 'git push --help' for details.

---I also tried the below command --

gunjan@Niyamgiri:~/tribalrights$ git push -u origin --allTo ssh://git@bitbucket.org/niyamgiri/tribalrights.git

! [rejected] master -> master (non-fast-forward)

error: failed to push some refs to 'ssh://git@bitbucket.org/niyamgiri/tribalrights.git'

To prevent you from losing history, non-fast-forward updates were rejected

Merge the remote changes (e.g. 'git pull') before pushing again. See the

'Note about fast-forwards' section of 'git push --help' for details.

Looks like somebody pushed changes to the repository after you pulled from it. Try pulling again, merge changes, resolve conflicts, commit and push again.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

2,289 views 9 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you