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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,755 views 1 5
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