TransWikia.com

Remove upstream from forked repository on GitHub

Web Applications Asked by Nathan Arthur on December 6, 2021

I forked a repository as a starting point for a new project, never intending to submit pull requests to the original repo. It’s become annoying to have to select my own master branch every time I want to merge a branch in the GitHub interface.

How can I remove the reference to the upstream so that my own master branch will be automatically selected when creating merge requests?

I tried editing .git/config as suggested here, but my config file does not include any reference to the upstream.

2 Answers

git remote rm upstream

Just discovered this by plugging-n-chugging. This is the command that removes the specified upstream.

Make sure to verify that the old upstream has been removed:

git remote -v

Anything marked with "upstream" should have been removed.

Now you can simply add a new upstream and start over (an example for Github):

git remote add upstream https://github.com/USERNAME/wellmap.github.io

Hope I helped!

Answered by Misha Lubich on December 6, 2021

Unfortunately, it doesn't seem to be possible. However, for a small project like mine, I was able to go with the less-than-ideal solution without too much pain:

  1. Make sure your local copy of the repo is up-to-date.
  2. Take a screen shot of, or otherwise note, open issues currently in the repo.
  3. Delete the repo on GitHub.
  4. Create a new repo on GitHub with the same name.
  5. In your local copy, modify the old remote to point to the new GitHub repo.
  6. Re-add issues, collaborators, etc, as needed.

Answered by Nathan Arthur on December 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP