Push origin - error

Hello,

Can someone light up with the below error?

D:\prjAutJava\ContentSpeedEdgeDriver\src\contentspeededgedriver>git commit
On branch master
nothing to commit, working tree clean

 

1
2
3
D:\prjAutJava\ContentSpeedEdgeDriver\src\contentspeededgedriver>git status
On branch master
nothing to commit, working tree clean

D:\prjAutJava\ContentSpeedEdgeDriver\src\contentspeededgedriver>git push -u origin master
To https://github.com/Anda77/AutJava.git
! [rejected]        master -> master (fetch first)
error: failed to push some refs to ‘https://Anda77@github.com/Anda77/AutJava.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.

I am very sure that i don’t understand something.

Thanks

The hint explain a lot:

  1. hint: Updates were rejected because the remote contains work that you do
  2. hint: not have locally. This is usually caused by another repository pushing
  3. hint: to the same ref. You may want to first integrate the remote changes
  4. hint: (e.g., ‘git pull …’) before pushing again.
  5. hint: See the ‘Note about fast-forwards’ in ‘git push --help’ for details.

probably some changes have been made in remote repository but not fetch in local, so you have to fetch and see whats change. You can try to solve this problem with in terminal, but there are some git gui client that facilitate this work. My preferred is gitkraken, it’s a powerfull tool to develop and work with git.

1 Like

Yeah. It looks like you need to pull your latest changes using git pull so you don’t overwrite anything from the master branch with your new changes.