简体   繁体   中英

Tell GitHub that my repository is a fork of another repository

I have a forked project in GitHub, that is not recognized as a fork of the upstream project. I must have screwed it up, not sure how. Because of that, I cannot make pull requests to the upstream project. How can I tell GitHub that my repository is a fork of another repository?

The only thing I came up with is to fork the project and then move my repository over to the new forked repository. But keeping all my local branches and history will be tedious, so I'm looking for a more elegant way.

Here's what worked for me:

  1. Rename non-forked repository
  2. Fork repository
  3. Go to your local repository, the remotes now point to the forked repository, simply push your changes to the new repository

And then you're good to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM