Skip to main content
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 behind

Quick 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
  1. 1Check git status
  2. 2Compare local and remote branches
  3. 3Check if there are incoming changes
  4. 4Review commit history
  5. 5Check branch protection rules

Solutions

Solution 1: Pull and merge remote changes
  1. 1Pull latest changes from remote
  2. 2Resolve any merge conflicts if they occur
  3. 3Commit the merge
  4. 4Push your changes

Commands to Run

Merge conflicts need manual resolution

git pull origin BRANCH_NAME

Creates merge commit

git push origin BRANCH_NAME
Solution 2: Rebase local changes on top of remote
  1. 1Fetch latest changes
  2. 2Rebase local branch on top of remote
  3. 3Resolve any conflicts during rebase
  4. 4Force push after rebase

Commands to Run

Rebase rewrites history

git pull --rebase origin BRANCH_NAME

Use --force-with-lease not --force

git push origin BRANCH_NAME --force-with-lease
Solution 3: Create a new branch
  1. 1Create a new branch from current state
  2. 2Push the new branch
  3. 3Create pull request for review
  4. 4Merge after approval

Commands to Run

May not be appropriate for protected branches

git checkout -b new-feature-branch

Follow team workflow

git push origin new-feature-branch
Prevention 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+

Was this helpful?