Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sharbel93/ebcf0b18782573f4d95f80caa3c84acb to your computer and use it in GitHub Desktop.
Save sharbel93/ebcf0b18782573f4d95f80caa3c84acb to your computer and use it in GitHub Desktop.
How to solve this problem of "! [rejected] master -> master (fetch first)"
First Do this ...
git fetch origin master
git merge master
Then, do this ...
git fetch origin master:tmp
git rebase tmp
git push origin HEAD:master
git branch -D tmp
Now everything works well.
@prince-cell
Copy link

Thank you so very much

@Nhyirabarima
Copy link

thanks so much. could you add some explanation?

@prince-cell
Copy link

prince-cell commented Jun 11, 2023 via email

@efronpaduansi
Copy link

Thank you so much.

@Bakil-Alqadhi
Copy link

Thank you so much!

@Ez-114
Copy link

Ez-114 commented Jul 30, 2023

Thank you so much, it really helped.
Can you please give more detailed explanation?

@MaryPortner
Copy link

Thank you so much for your help !!!

@mannnrachman
Copy link

Thank you sir.

@nderinicholus
Copy link

Thanks. This was very helpful.

@samirbobo
Copy link

Thanks, a lot

@MicheleWM
Copy link

muito obrigada, estava horas tentando resolver!

@Harshninave04
Copy link

Thanks a lot !!!!! This was helpful.

@simran-01
Copy link

Thanks !

@naufalazim
Copy link

Thank you.

@MADIWALAR-AKSHATA
Copy link

Thank You, Its worked.

@geilsonfreire
Copy link

Muito obrigado!
Já estava quase desistindo.
Vc poderia explicar sobre o que esse código está corrigindo?

@igomarcelino
Copy link

Thank you.

@Alok2304
Copy link

I don't know how but when I ran those comments in a serial manner . I was able to update my folder in my Github repository. It worked like magic.

@Prono96
Copy link

Prono96 commented Dec 9, 2023

it worked like a magic
Thanks man

@GorkemSay
Copy link

Thank you. First it did not work for me but I changed the "master" to "main". Looks like Github uses main instead of master.

@Eutop1a
Copy link

Eutop1a commented Feb 5, 2024

much appreciate

@kaisar672
Copy link

Thanks.It works perfectly

@bishwajeet0771
Copy link

Thanks. It work completely fine

@Avinashyennam
Copy link

it worked

@thyagofranca
Copy link

valeu meu patrão

@samh139
Copy link

samh139 commented Apr 11, 2024

Thank you so much brother , you are really a gem. Once again, thanks mate..!!!

@mendes79
Copy link

Thanks so much! It's works very well! UP

@22vedant
Copy link

Thank you!

@SabaloZua
Copy link

Thank you bro💯💯💯!

@pichuka123
Copy link

this is working only for the first time sir.. again if i made any changes and push, again this error appearing.
any permanent fix for this please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment