Git refusing-to-update-checked-out-branch A push into a non-bare repository's active branch was denied by that repository's settings.

dev@local: ~/project — git
dev@local~/project$git status
error: refusing to update checked out branch
Diagnostics Translation
A push into a non-bare repository's active branch was denied by that repository's settings.
waiting for resolution...
MediumVersion Control System

Reviewed for reference consistency: August 11, 2026

Code is Safe

SECURE

Git has paused the operation to protect your code. No data has been lost or corrupted.

What To Know

The destination repository protected its own checkout: the commits were received but the branch ref was not moved, because that branch is the one the destination has checked out.

Where Did It Fail?

Working Tree
Your local files
add
Staging Index
Prepared changes
commit
Local Repo
Commit history
push/fetch
Remote Server
GitHub/GitLab
The error involves the internal Git database or commit history structure.

Commands That Trigger This

Pushing to a teammate's repository over SSH where their main branch is checked out
A deploy setup pushing into a live checkout instead of a bare repository
Pushing from a workstation into another clone on the same machine

Technical Background

01

The protection exists because pushed commits would exist only in the object database. The checked-out files and index would still describe the old commit, and the divergence would stay invisible until someone inspected the server directory.

02

The remote controls the outcome: bare repositories have no current branch and accept such pushes without comment, while non-bare ones can set receive.denyCurrentBranch to updateInstead to apply incoming changes to the work tree, or to warn and ignore knowingly. The client cannot override any of this.

Underlying Causes

The target repository is non-bare and holds the branch as its current HEAD
receive.denyCurrentBranch is left at its default refusing behavior
The deployment flow expects a server checkout to update itself on push
The receiving repository was created with a plain init instead of a bare init

Frequently Asked Questions

A bare repository has no index or working tree to drift out of sync, so there is nothing for the guard to protect.

updateInstead updates the checked-out files to match the pushed commit when the work tree is clean, while ignore accepts the push and leaves the work tree stale.

Related Git States