Gitexit code > 0

error: failed to push some refs

$error: failed to push some refs to '[email protected]:user/repo.git'

Analysis

Your push was rejected because the remote repository has changes that you don't have locally.

Common Triggers

  • Another developer pushed changes to the same branch.
  • You are trying to push to a branch that has diverged.

Debug Checks

  • $Run git fetch and git status to see the difference.

Resolution

1
Pull the remote changes: git pull origin <branch>.
2
If you are sure, use force push (CAUTION): git push -f.