Currently Available: Need a skilled Software Developer for your next project?
Categories
Git

How to Rename Your GitHub Project Locally and Remote

Here's how to rename your project both on GitHub and your local development machine.

Renaming on GitHub

First, let's rename the repository on GitHub's web interface:

  1. Navigate to your repository on GitHub
  2. Click on "Settings" in the top navigation bar
  3. In the "General" section, find the "Repository name" field
  4. Enter your desired new name
  5. Click the "Rename" button to confirm

GitHub will automatically handle redirects from the old repository URL to the new one, making this process seamless for any existing clones or references.

Updating Your Local Environment

After renaming the repository on GitHub, you'll need to update your local environment to match. Here's how:

# Navigate to the parent directory containing your project
cd /path/to/parent/directory

# Rename the local directory
mv old-name new-name

# Change into the newly renamed directory
cd new-name

# Update the git remote URL to point to the new repository name
git remote set-url origin https://github.com/username/new-name.git

Verifying the Changes

To ensure everything is properly configured, run these verification commands:

# Check that the remote URL has been updated correctly
git remote -v

# Verify the git status
git status

If everything is set up correctly, you should see the new repository URL in the remote output, and git status should show your working directory is clean (assuming you haven't made any other changes).

What I'm building

Delegate tasks. Get software.

Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.

Take a look at vroni.com

Subscribe to my newsletter

Get new posts when I publish them.

I respect your privacy. Unsubscribe at any time.

One thought on “How to Rename Your GitHub Project Locally and Remote

Leave a Reply

Your email address will not be published. Required fields are marked *