Skip to content

Renaming Git Repos

Last updated 2026-08-20 · 3 notes · 3 tags

Tags: git github rename

Use this when the GitHub repo was renamed (or you renamed the local folder) and a second computer still points at the old name.

Note: Rename the repo on GitHub first (Settings → General → Repository name). Then update each computer as below.

1. Open your projects folder

cd ~/projects

2. Rename the local folder (if needed)

mv old-repo-name new-repo-name
cd new-repo-name

3. Point Git at the new GitHub URL

git remote set-url origin https://github.com/YOUR_GITHUB_USERNAME/YOUR_REPO.git

Note: Replace YOUR_GITHUB_USERNAME and YOUR_REPO with the values shown on the repo’s GitHub page (green Code button).

4. Fetch and pull

git fetch origin
git pull

5. Verify

git remote -v
git status

You should see the new URL under origin and a clean status (or only your local unfinished work).

Note: SSH users will use a URL like git@github.com:YOUR_GITHUB_USERNAME/YOUR_REPO.git instead of https://....

Common mistakes

  • Update every machine that still has a clone of the old name.
  • If git pull complains about unrelated histories, stop and get help — do not force-push until you understand the warning.

This project chronicles ideas, decisions and lessons I have gleaned from building with AI. The goal is to help non-technical users get familiar with these tools and techniques, so that they may be able to use them effectively. At times, I have also made the use of AI tools to augment or refine the content.

Readers are responsible for using any commands or instructions published here with due caution. The creator of this site accepts no responsibility for any system damage, data loss or other consequences, resulting from the application of this content.