Saturday, January 23, 2021

Git: Updates were rejected because a pushed branch tip is behind its remote counterpart

 

>PROBLEM


Git push fails returning "Updates were rejected because a pushed branch tip is behind its remote counterpart...".


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

error: failed to push some refs to .. SOME DIR PATH

hint: Updates were rejected because a pushed branch tip is behind its remote

hint: counterpart. Check out this branch and 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.



>SOLUTION


Following the hint suggested in the output:

  git push --help


The --force option solves:

  git push --force origin master

  

Because it was behind the counterpart, it may cause some side effect on log.

When performed the command, everything was fine, no issues, but another client had to push with --force flag too, but no further issues.



>ENV

Windows 10

Git version 2.19.1.windows.1


No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...