How to fix remote: Repository is read-only. Please contact the repository administrator. in Git

GitBEGINNERMEDIUMUpdated Dec 6, 2025· 252 views

The 'Repository is read-only' error in Bitbucket occurs when you try to push changes but lack write permissions. This is typically caused by insufficient access rights, repository archival, account suspension, or hitting storage quotas.

Quick fix

Fixes remote: Repository is read-only. Please contact the repository administrator.

# Verify which remote you're pushing to
git remote -v

# Confirm your Bitbucket username
git config user.name
  1. Check your repository access permissions
  2. Check if the repository is archived
  3. Verify workspace storage quota
  4. Check for account or workspace suspension
git — error
# Verify which remote you're pushing to
git remote -v
# Confirm your Bitbucket username
git config user.name
remote: Repository is read-only. Please contact the repository administrator.

What this error means

This error indicates that Bitbucket has explicitly blocked write operations to the repository. The server received your push request and authenticated you successfully, but it refuses to accept any changes because the repository is in a read-only state. Unlike permission-denied errors where your credentials may be wrong, this error means Bitbucket recognized who you are but the repository itself is not accepting modifications. The repository could be archived, under maintenance, locked by an administrator, or your account may lack write privileges. Common scenarios that trigger this error include: 1. **Repository archived** - The repository has been archived and is now read-only by design 2. **Insufficient permissions** - Your account has read access but not write access 3. **Workspace storage quota exceeded** - Bitbucket workspaces have storage limits 4. **Account suspension** - Your Bitbucket account or workspace may be suspended 5. **Repository maintenance** - Temporary read-only state during migrations or maintenance 6. **Branch restrictions** - Some branches may be protected from direct pushes

Typical symptoms

  • Git push fails with 'remote: Repository is read-only' message
  • Can clone and pull from the repository but cannot push
  • Error appears immediately after authentication succeeds
  • Push works to other repositories but not this specific one
  • CI/CD pipelines fail during the push stage
  • Pull requests cannot be merged
  • All team members experience the same push failure
  • Error mentions contacting the repository administrator

Common causes

  1. Repository has been archived by an administrator
  2. Your Bitbucket account lacks write permissions to the repository
  3. Workspace storage quota has been exceeded
  4. Bitbucket account or workspace is suspended or restricted
  5. Repository is undergoing maintenance or migration
  6. Branch protection rules blocking pushes to specific branches
  7. Repository is in a degraded state due to server issues
  8. Free tier limitations on private repositories
  9. Organization enforced repository lock for compliance
  10. App password or access token lacks write scope

How to fix "remote: Repository is read-only. Please contact the repository administrator."

1Check your repository access permissions

First, verify that you have write access to the repository:

1. Go to the repository on Bitbucket (bitbucket.org)
2. Click Repository settings in the left sidebar
3. Navigate to User and group access
4. Find your username and check your permission level

Permission levels in Bitbucket:
- Read - Can clone and pull only (causes this error)
- Write - Can push to most branches
- Admin - Full access including settings

If you have only Read access, ask a repository administrator to grant you Write access.

bash
# Verify which remote you're pushing to
git remote -v

# Confirm your Bitbucket username
git config user.name
2Check if the repository is archived

Archived repositories are read-only by design. Check if this is the case:

1. Go to the repository page on Bitbucket
2. Look for an "Archived" badge or banner at the top
3. If archived, you'll see "This repository has been archived"

To unarchive a repository (requires admin access):
1. Go to Repository settings
2. Navigate to Repository details
3. Scroll to the bottom and click Unarchive repository
4. Confirm the action

If you don't have admin access, contact the repository owner to unarchive it.

Alternative: Fork the repository
If the repository should remain archived, you can fork it:

bash
# Remove the old remote
git remote remove origin

# Add your forked repository as the new origin
git remote add origin git@bitbucket.org:YOUR_USERNAME/repo.git

# Push to your fork
git push -u origin main
3Verify workspace storage quota

Bitbucket workspaces have storage limits. If exceeded, repositories become read-only:

Check workspace storage:
1. Go to your workspace settings on Bitbucket
2. Click Plans and billing or Storage (depending on your plan)
3. Check the storage usage graph

Free tier limits:
- Bitbucket Free: 1 GB soft limit, 2 GB hard limit per workspace
- Over 1 GB: Warning notifications
- Over 2 GB: Repositories become read-only

Solutions:
1. Delete old branches:

bash
# List merged branches
git branch -r --merged main

# Delete remote branches
git push origin --delete feature/old-branch

2. Clean up large files:

bash
# Find large files in history
git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | awk '/^blob/ {print $3, $4}' | sort -rn | head -20

# Use BFG Repo-Cleaner to remove large files
# See: https://rtyley.github.io/bfg-repo-cleaner/

3. Upgrade your Bitbucket plan for more storage

4Check for account or workspace suspension

Your Bitbucket account or workspace may be suspended:

Check account status:
1. Go to [bitbucket.org/account/settings](https://bitbucket.org/account/settings/)
2. Look for any warning banners or notifications
3. Check your email for messages from Bitbucket about account issues

Common suspension reasons:
- Billing issues (expired credit card, unpaid invoices)
- Terms of service violations
- Security concerns (compromised account)
- Inactivity on premium plans

To resolve:
1. Log in to your Atlassian account
2. Go to [my.atlassian.com](https://my.atlassian.com)
3. Check for any pending actions or payments
4. Update payment information if needed
5. Contact Atlassian Support if the issue persists

If your personal account is fine, check the workspace settings:
1. Go to the workspace
2. Navigate to Settings > Plans and billing
3. Resolve any billing or compliance issues

5Verify app password or access token permissions

If you're using an app password or access token, it may lack write permissions:

For App Passwords:
1. Go to [bitbucket.org/account/settings/app-passwords](https://bitbucket.org/account/settings/app-passwords/)
2. Check your existing app password's permissions
3. Ensure Repositories: Write is enabled

Create a new app password with correct permissions:
1. Click Create app password
2. Give it a descriptive label
3. Select permissions:
- Repositories: Read, Write
- Pull requests: Read, Write (if needed)
4. Click Create
5. Copy the password immediately (it won't be shown again)

Update Git to use the new app password:

bash
# For HTTPS URLs, update stored credentials
# On macOS:
git credential-osxkeychain erase
host=bitbucket.org
protocol=https
# Press Ctrl+D

# On Windows:
# Open Credential Manager and remove Bitbucket entries

# On Linux:
rm ~/.git-credentials
# Or edit and update the entry

Then push again and enter your username and new app password when prompted.

6Check branch protection rules

Bitbucket may have branch permissions blocking your push:

Check branch restrictions:
1. Go to Repository settings
2. Navigate to Branch restrictions (under Workflow)
3. Look for rules affecting your target branch

Common restrictions:
- Direct pushes blocked (must use pull requests)
- Only certain users can push to protected branches
- Force push disabled on main/master

Solutions:

Option 1: Push to a different branch

bash
# Create and push to a feature branch instead
git checkout -b feature/my-changes
git push -u origin feature/my-changes

# Then create a pull request to merge into the protected branch

Option 2: Request push access
Contact a repository admin to add you to the list of users who can push to the protected branch.

Option 3: Modify branch restrictions (if admin)
1. Go to Branch restrictions
2. Edit the rule for the target branch
3. Add yourself or your team to the allowed users/groups

7Use SSH instead of HTTPS

If HTTPS authentication is causing issues, try SSH:

Set up SSH key for Bitbucket:

bash
# Generate a new SSH key (if needed)
ssh-keygen -t ed25519 -C "your_email@example.com"

# Start the SSH agent
eval "$(ssh-agent -s)"

# Add your key
ssh-add ~/.ssh/id_ed25519

# Copy your public key
cat ~/.ssh/id_ed25519.pub

Add the SSH key to Bitbucket:
1. Go to [bitbucket.org/account/settings/ssh-keys](https://bitbucket.org/account/settings/ssh-keys/)
2. Click Add key
3. Paste your public key
4. Give it a label and save

Update your remote URL to use SSH:

bash
# Check current remote
git remote -v

# Change from HTTPS to SSH
git remote set-url origin git@bitbucket.org:workspace/repo.git

# Test the connection
ssh -T git@bitbucket.org

# Try pushing again
git push origin main
8Contact Bitbucket Support or repository administrator

If none of the above solutions work, the repository may be locked at the server level:

Contact repository administrator:
The error message specifically says "Please contact the repository administrator." This means someone with admin access needs to investigate:

1. Identify who has admin access to the repository
2. Ask them to check:
- Repository archive status
- User permissions
- Workspace billing status
- Any recent maintenance or migration

Contact Atlassian Support:
If you're an administrator and still can't resolve it:

1. Go to [support.atlassian.com](https://support.atlassian.com)
2. Select Bitbucket Cloud
3. Describe the issue with:
- Repository URL
- Exact error message
- Steps you've already tried
- When the issue started

Check Bitbucket Status:
The issue might be on Bitbucket's end:
1. Visit [status.bitbucket.org](https://status.bitbucket.org)
2. Check for any ongoing incidents
3. Subscribe to updates if there's an outage

Advanced notes

### Understanding Bitbucket's Read-Only States

Bitbucket repositories can become read-only for several infrastructure reasons:

Planned read-only states:
- Repository archival (intentional by admin)
- Workspace migration between regions
- Repository transfer between workspaces
- Storage quota enforcement

Unplanned read-only states:
- Backend storage issues
- Database maintenance
- Disaster recovery operations

### Bitbucket Pipelines and CI/CD Implications

If your CI/CD pipeline uses Bitbucket Pipelines and pushes back to the repository (e.g., version bumps, changelog updates), ensure:

yaml
# bitbucket-pipelines.yml
pipelines:
  default:
    - step:
        script:
          # Use the built-in Bitbucket Pipelines git push
          - git push origin main
        # The pipeline's OAuth has write access by default
        # Check Settings > Pipelines > Repository variables

For external CI (Jenkins, GitHub Actions):
- Use dedicated deployment credentials with write scope
- Store credentials securely in CI secrets
- Verify the app password has Repository: Write permission

### Bitbucket Workspaces vs Repositories

Permissions cascade from workspace to repository:

1. Workspace members inherit default permissions
2. Repository permissions can restrict but not exceed workspace level
3. Branch permissions add another restriction layer

If you're an admin at the workspace level but not the repository level, you may still be blocked.

### Git LFS and Large File Storage

Bitbucket has separate quotas for Git LFS:

bash
# Check if LFS is causing issues
git lfs status
git lfs ls-files

# LFS has its own storage limit
# Check: Workspace settings > Git LFS

If LFS quota is exceeded, even small text file pushes may fail.

### API-Based Repository Lock

Bitbucket admins can lock repositories via the REST API:

bash
# Check repository metadata (requires admin access)
curl -u username:app_password \
  https://api.bitbucket.org/2.0/repositories/workspace/repo

# Look for "is_private" and any lock indicators in the response

### Mirroring and Forked Repositories

If the repository is a mirror or fork with restricted settings:
- Mirrors are typically read-only by design
- Forks may have push restrictions from the parent
- Check if the repository is a mirror: Repository settings > Mirroring

### Recovery from Quota Issues

After resolving storage quota:
1. Wait a few minutes for Bitbucket to update
2. Try pushing a small change first
3. If still failing, contact support - there may be a propagation delay

bash
# Test with a minimal commit
echo "test" >> test.txt
git add test.txt
git commit -m "Test push after quota fix"
git push origin main

Frequently asked questions

What does "remote: Repository is read-only. Please contact the repository adminis" mean?
This error indicates that Bitbucket has explicitly blocked write operations to the repository. The server received your push request and authenticated you successfully, but it refuses to accept any changes because the repository is in a read-only state. Unlike permission-denied errors where your credentials may be wrong, this error means Bitbucket recognized who you are but the repository itself is not accepting modifications.
How do I fix "remote: Repository is read-only. Please contact the repository adminis"?
The 'Repository is read-only' error in Bitbucket occurs when you try to push changes but lack write permissions. This is typically caused by insufficient access rights, repository archival, account suspension, or hitting storage quotas.
What causes "remote: Repository is read-only. Please contact the repository adminis"?
Repository has been archived by an administrator Your Bitbucket account lacks write permissions to the repository Workspace storage quota has been exceeded
Is the "remote: Repository is read-only. Please contact the repository adminis" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading