dev@local: ~/project — git
dev@local~/project$git push
To github.com:developer/project.git
! [rejected] main -> main (fetch first)
error: remote rejected
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
Diagnostics Translation
The remote server actively refused to accept your pushed commits due to server-side rules.
waiting for resolution...
MediumVersion Control System

Reviewed for reference consistency: April 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

This state points to a remote-side rule, permission, or policy decision rather than a broken local repository.

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 occurred during a network exchange. Your local files are untouched, but Git cannot reach the remote server.

Commands That Trigger This

$git push
Running to a GitHub repository where the `main` branch requires a Pull Request
$Pushing a commit that contains a file size exceeding the server's maximum limit
Pushing a commit that contains a file size exceeding the server's maximum limit

Technical Background

01

Remote platforms like GitHub, GitLab, or Bitbucket implement their own authorization and hook layers on top of Git.

02

When these platforms reject a push, they usually provide a specific reason in the terminal output (e.g., 'pre-receive hook declined' or 'protected branch').

Underlying Causes

Pushing directly to a protected branch (like `main` or `master`)
Failing a server-side hook (e.g., missing issue tracker ID in commit message)
Lacking sufficient write permissions for the repository

Frequently Asked Questions

Usually no. The rejection typically comes from a remote rule, permission layer, or server-side policy, so the local client cannot simply ignore it.

Related Git States