Skip to content

Instantly share code, notes, and snippets.

@reeddunkle
Last active June 26, 2016 18:56
Show Gist options
  • Select an option

  • Save reeddunkle/4cab3c691d23a112a837053c7cfa3f67 to your computer and use it in GitHub Desktop.

Select an option

Save reeddunkle/4cab3c691d23a112a837053c7cfa3f67 to your computer and use it in GitHub Desktop.
So that I stop forgetting what to do

When you rename a Python GitHub Repo:

Fix the URL that your local repository uses to find its remote respository

  • Copy your repo's new URL, and head to the terminal:
git remote -v  # See your old URL
git remote set-url origin https://github.com/[your-name]/**[NEW-REPO-NAME].git**
git remote -v # See your new URL

Fix your virtualenv (Python)

  • Edit your venv/bin/pip file at the top:
subl venv/bin/pip

#!/home/.../CHANGE_TO_NEW_NAME/venv/bin/python

  • Edit your venv/bin/activate file at line ~43:
subl venv/bin/activate

Edit the path to have the new name:

VIRTUAL_ENV = "/home/.../CHANGE_TO_NEW_NAME/venv"

Note: I've recently started using virtualenvwrapper and it takes care of this issue by separating the virtualenv's dependencies from the project and its folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment