cicdbeginnerversion-controlVerified
Git Push Rejected: Causes and Fixes
Last reviewed: 9/14/2026
3 solutions
Exact Error Message
Updates were rejected because the tip of your current branch is behindQuick Fix
Pull latest changes first: git pull or git pull --rebase then push.
What This Error Means
Push rejection occurs when the remote branch has commits that don't exist in your local branch. This happens when someone else pushed changes after you last pulled.
Common Symptoms
- •Git push fails with rejected error
- •Cannot push changes to remote
- •Branch is behind remote
- •Merge conflicts may occur
Common Causes
- •Remote has new commits
- •Multiple people working on same branch
- •Forgot to pull before pushing
- •Branch divergence
- •Force push rejected by protected branch
Diagnostic Steps
- 1Check git status
- 2Compare local and remote branches
- 3Check if there are incoming changes
- 4Review commit history
- 5Check branch protection rules
Solutions
Solution 1: Pull and merge remote changes
- 1Pull latest changes from remote
- 2Resolve any merge conflicts if they occur
- 3Commit the merge
- 4Push your changes
Commands to Run
Merge conflicts need manual resolution
git pull origin BRANCH_NAMECreates merge commit
git push origin BRANCH_NAMESolution 2: Rebase local changes on top of remote
- 1Fetch latest changes
- 2Rebase local branch on top of remote
- 3Resolve any conflicts during rebase
- 4Force push after rebase
Commands to Run
Rebase rewrites history
git pull --rebase origin BRANCH_NAMEUse --force-with-lease not --force
git push origin BRANCH_NAME --force-with-leaseSolution 3: Create a new branch
- 1Create a new branch from current state
- 2Push the new branch
- 3Create pull request for review
- 4Merge after approval
Commands to Run
May not be appropriate for protected branches
git checkout -b new-feature-branchFollow team workflow
git push origin new-feature-branchPrevention Tips
- ✓Pull before pushing
- ✓Use feature branches for development
- ✓Set up branch protection rules
- ✓Use pull requests for main branch
- ✓Communicate with team members
Version Notes: Applies to Git 2.0+
Official Documentation
Was this helpful?