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

git push origin not working

Gunjan Arya July 8, 2012

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.

10 answers

1 accepted

8 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
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.
July 8, 2012

Have you committed your changes before pushing?

Gunjan Arya July 8, 2012

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
Like # people like this
Jobin Kuruvilla [Adaptavist]
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.
July 8, 2012

Do git add first and then commit.

Like # people like this
Gunjan Arya July 8, 2012

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.

Like Nilesh Chatre likes this
Jobin Kuruvilla [Adaptavist]
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.
July 9, 2012

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

Nilesh Chatre November 17, 2019

same problem with me.... fuck 

trying from 2 days but still not working...

Gokul M December 29, 2019

i have to upload my files to my new repositary..

but i can't upload it..

the error is still there in git bash.

Haseeb Sultan April 11, 2020

I had the exact same problem. Nothing helped untill I tried this:

git pull --rebase origin master

After that, run push command i.e.

git push -u origin master

SOLVED FOR ME!!

Like # people like this
bx_ijas April 14, 2020

it worked for me..thanks alot

Abheek Desai April 17, 2020

thanks worked for me too

Adeniran Adekola July 14, 2020

it work for me thanks alot

Guene Joseph November 15, 2020

Thanks... It worked for me... You saved my day!!!

jemauthentic February 10, 2021

worked for me

2 votes
jyoti_kumari May 7, 2020

git push origin master --force

I had the same problem .Hope it will work  .

milansheth September 3, 2020

You saved my day. I don't know what exactly the problem is either with bitbucket or android studio? I have been working hard to resolve this issue but finally your git command helped me.  

1 vote
Issac Nguyen October 24, 2019

I solved problem with command:

 git pull --allow-unrelated-histories
owais_ul_haq April 9, 2020

Thank you, I had this error

! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://owaisullhaq@bitbucket.org/owaisullhaq/bank.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first 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.

and it solved by this command. And write "git push -u origin master" after this command worked.

Issac Nguyen April 9, 2020

You're welcome, I find somewhere else, but not found right solution. So I posted here for all you guy need it.

0 votes
ami6c May 14, 2021

 

What worked for me:

   - Open the repository on bitbucket

   - Go to "Repository settings"

   - In "Repository details" > "Large File Storage (LFS)" tick "Allow LFS"

   - Than I was able to push w/o the error saying "failed to push some refs"

Capture.PNG

0 votes
Ashikul Hasan Shakil February 1, 2021

I am facing this problem and i am traying to solve by avobe comment..but i can't solve this then i wrote "git push --all" and i got it🥰🥰.if you face same problem .i suggest to you ..try this ..In Sha Allah you will get it..

Screenshot (318).png

0 votes
omkar gaonkar July 20, 2020

Guy's if you are facing same issue push forcefully git push origin master --force 

0 votes
Vibhanshu Garg May 9, 2020

git pull --rebase origin master

git push -u origin master

Try this..It will work. Worked for me:)

0 votes
Mouhamed Lamine Ngom January 29, 2020

Make sure that you add  files

git status 

git add .

git commit 

git push 

 

I had the same problem I solve it by this way. Hope it will work 

0 votes
Vinh Nguyen April 28, 2019
git commit -m "initial commit"
git push origin master

For some reason when I did this it worked...  

Luis Miguel June 27, 2020

Wow, thanks a lot !!

0 votes
ajkr195 December 3, 2018

Bitbucket is getting uglier everyday. The most lethal combination is Spring STS and Bitbucket. 

Bitbucket will fail you whenever you need it the most without any good reason.

ajkr195 December 3, 2018

It getting sluggish like Microsoft Windows Everyday.

Praveen Kumar January 10, 2019
<p>bitbucket is not good anymore</p>
Like Karl Nicholas likes this
erosmarcus February 26, 2019

i face a lot of problems in bitbucket. fuck

Like Issac Nguyen likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events