This error occurs when you try to push commits, create issues, or make any changes to a GitHub repository that has been archived by its owner. Archived repositories are read-only and cannot accept any modifications.
The error "remote: error: GH003: This repository has been archived by the owner. It is now read-only" means you're attempting to push changes to a GitHub repository that has been deliberately marked as archived by its owner or administrator. When a repository is archived on GitHub, it becomes completely read-only for everyone—including the repository owners themselves. The "GH003" is a GitHub-specific error code indicating an archived repository rejection. **Why repositories get archived:** - The project has been discontinued or abandoned - The project has migrated to a new repository or organization - The project was created for a specific purpose that's now complete - The owner wants to preserve the code but prevent further changes - The project has been superseded by a newer version An archived repository is not deleted—all the code, issues, pull requests, and history remain visible and accessible. You can still clone it, fork it, and read everything. You just cannot make any modifications to the original repository.
First, confirm that the repository is actually archived:
# Visit the repository on GitHub
# Look for the yellow banner at the top that says:
# "This repository has been archived by the owner. It is now read-only."
# You can also check via the GitHub API
curl -s https://api.github.com/repos/OWNER/REPO | grep archived
# Output: "archived": trueIf you see the archived banner or the API returns "archived": true, the repository is indeed archived.
The most common solution is to fork the archived repository to your own account:
# On GitHub, click the "Fork" button on the archived repository
# This creates a copy under your account that you can modify
# Clone your fork
git clone https://github.com/YOUR-USERNAME/REPO.git
cd REPO
# Add the original as upstream (for reference)
git remote add upstream https://github.com/ORIGINAL-OWNER/REPO.git
# Make your changes and push to YOUR fork
git add .
git commit -m "Your changes"
git push origin mainYour fork is a completely independent repository that you control. You can develop, accept pull requests, and manage it however you like.
If you've already cloned the archived repository and made commits locally, redirect your pushes to a fork:
# First, create a fork on GitHub (via the web interface)
# Check your current remote
git remote -v
# origin https://github.com/ORIGINAL-OWNER/REPO.git (fetch)
# origin https://github.com/ORIGINAL-OWNER/REPO.git (push)
# Update the remote to point to your fork
git remote set-url origin https://github.com/YOUR-USERNAME/REPO.git
# Verify the change
git remote -v
# origin https://github.com/YOUR-USERNAME/REPO.git (fetch)
# origin https://github.com/YOUR-USERNAME/REPO.git (push)
# Now push your changes
git push origin mainAll your local commits will now push to your fork instead of the archived repository.
If you need the original repository unarchived and have a relationship with the owner:
1. Check for contact information in the repository README, description, or CODEOWNERS file
2. Open a discussion (if discussions are enabled on the archived repo)
3. Contact them through other channels (Twitter, email, company Slack)
Note: Only repository owners or organization administrators can unarchive a repository. If you're the owner yourself, you can unarchive through Settings.
If you own the repository and want to unarchive it:
1. Go to your repository on GitHub
2. Click Settings (gear icon)
3. Scroll down to the Danger Zone section
4. Click Unarchive this repository
5. Read the warning message carefully
6. Type the repository name to confirm
7. Click I understand the consequences, unarchive this repository
# After unarchiving, verify you can push
git push origin main
# If using GitHub CLI
gh repo unarchive OWNER/REPOThe repository will immediately become writable again for all collaborators.
Many archived repositories indicate where the project has moved:
# Check the README for migration notices
# Look in the repository description
# Check pinned issues or the wiki
# Common patterns:
# - "This project has moved to https://github.com/new-org/new-repo"
# - "Superseded by project-v2"
# - "Merged into monorepo at ..."If the project has moved, you should:
1. Clone the new repository
2. Set up your remotes to point to the new location
3. Migrate any local changes you made
If your CI/CD pipeline is failing because it tries to push to an archived repository:
# For GitHub Actions that push tags/releases:
# You need to update the repository reference
# Example: Update workflow to push to a fork
- name: Push changes
run: |
git remote set-url origin https://github.com/YOUR-ORG/YOUR-FORK.git
git push origin main
# Or skip the push step entirely if the repo is archived
- name: Push changes
if: ${{ github.repository != 'archived-owner/archived-repo' }}
run: git push origin mainFor other CI systems (Jenkins, CircleCI, etc.), update the repository URL in your pipeline configuration.
### What Gets Locked When a Repository is Archived
When a repository is archived, these elements become read-only:
| Element | Can Read? | Can Modify? |
|---------|-----------|-------------|
| Code/commits | Yes | No |
| Issues | Yes | No (can't create, edit, or comment) |
| Pull requests | Yes | No (can't create, merge, or comment) |
| Wiki | Yes | No |
| Releases | Yes | No |
| Branches/tags | Yes | No |
| Labels/milestones | Yes | No |
| Projects | Yes | No |
| Collaborator list | Yes | No |
| Settings | Yes | No (except unarchive) |
### What You Can Still Do with Archived Repositories
- Clone: git clone works normally
- Fork: You can fork to your own account
- Star: You can star/unstar the repository
- Watch: You can watch/unwatch
- Download: ZIP/tarball downloads work
- View all history: All commits, branches, and tags are accessible
- Reference in dependencies: Package managers can still install from archived repos
### GitHub API and Archived Repositories
# Check if a repository is archived via API
curl -s https://api.github.com/repos/OWNER/REPO | jq '.archived'
# Attempt to create an issue (will fail with 403)
curl -X POST \
-H "Authorization: token YOUR_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/issues \
-d '{"title":"Test"}'
# Response: {"message":"Repository was archived so is read-only."}### Archiving vs. Deleting vs. Making Private
| Action | Code Preserved | History Preserved | Publicly Accessible | Can Undo |
|--------|---------------|-------------------|---------------------|----------|
| Archive | Yes | Yes | Yes (if was public) | Yes |
| Delete | No | No | No | No* |
| Make Private | Yes | Yes | No | Yes |
*Deleted repositories may be recoverable within 90 days by contacting GitHub support.
### GitHub CLI Commands for Repository Management
# Archive a repository
gh repo archive OWNER/REPO
# Unarchive a repository
gh repo unarchive OWNER/REPO
# View repository info including archive status
gh repo view OWNER/REPO --json isArchived
# Fork an archived repository
gh repo fork OWNER/REPO --clone### Best Practices for Archived Repository Consumers
1. Check the archive date: Recent archives might be unarchived soon
2. Look for active forks: Someone may be maintaining an active fork
3. Review open issues/PRs: Might contain important information or patches
4. Check package manager status: npm/pip packages may still be updated separately
5. Consider the license: Ensure you can legally fork and continue development
### Handling Dependencies on Archived Repositories
If your project depends on an archived repository:
// package.json - point to your fork or a specific commit
{
"dependencies": {
"archived-package": "github:your-username/archived-package-fork"
}
}# requirements.txt - use git URL to a fork
git+https://github.com/your-username/archived-package-fork.git@mainFor long-term maintenance, consider publishing your fork as a new package with proper attribution.
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server
fatal: unable to access: Proxy auto-configuration failed
How to fix 'Proxy auto-configuration failed' in Git
fatal: unable to access: Authentication failed (proxy requires basic auth)
How to fix 'Authentication failed (proxy requires basic auth)' in Git
fatal: unable to access: no_proxy configuration not working
How to fix 'no_proxy configuration not working' in Git
fatal: unable to read tree object in treeless clone
How to fix 'unable to read tree object in treeless clone' in Git