12

I did contribute to a github project.

  • I forked the project
  • Did my stuff
  • Asked for a pull request that was accepted.
  • Now, my branch is perfectly in sync with the master project. Nice.

I dont' want anyone to fork from my version on github, but I prefer them to feed themselves from the original project. So I want to delete my "master branch" which represent a "Delete repository" operation....

My question is: If I delete it, and one day I would like to contribute again to the same project, will I get some strange behaviors on a "re-fork" ? Will I loose some information like issues etc... ?

Does anyone with extensive experience on github can hint me ont that ?

user2314737
  • 27,088
  • 20
  • 102
  • 114
  • Not sure where you are going with this, when you delete your fork and later fork again from the master branch - it's a completely new fork. – Manfred Radlwimmer Dec 16 '17 at 21:32

1 Answers1

11

You can delete your fork actually (not just the master branch), this can be done in the repo's settings danger zone as described on https://docs.github.com/en/repositories/creating-and-managing-repositories/deleting-a-repository

Once deleted, you will be able (as seen here) to re-fork the original project at any time.
As mentioned here, as long as your PR (Pull Requests) are accepted, you can delete your fork. Or you can delete it even if your PR is pending... but it would then disappear along with your fork (it would still be visible in the upstream original repo though).

Official documentation: "Tidying up after Pull Requests" (for branches only, but you can apply the same idea to fork deletion).

carl verbiest
  • 1,113
  • 1
  • 15
  • 30
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • how about my contribution graph, will it lost? (my green commit graph on github profile) – kafinsalim Jun 09 '20 at 09:51
  • @kafinsalim I don't think your contribution graph reflects commits done in a fork (see https://help.github.com/en/github/setting-up-and-managing-your-github-profile/why-are-my-contributions-not-showing-up-on-my-profile#commits), only on original repositories (that you own, or where your pull request have been accepted). So deleting a fork shouldn not affect your contribution graph. – VonC Jun 09 '20 at 09:53
  • Can you expand on "it would still be visible in the upstream original repo though" so does the PR disappear or can I re-create the repo with the same name and branch name and push changes to the original PR? My problem is I forked a fork and now I want to restart my fork from the original repo but I have a PR still open. – Boris Verkhovskiy Jun 27 '21 at 21:55
  • @Boris I have not tested it directly, but you should be able to push back (from your new fork) to your original remote PR branch, which should update that PR. – VonC Jun 27 '21 at 22:20
  • 1
    where the hell is the button to press for deleting my fork? – woodz Nov 05 '22 at 23:13
  • @woodz I suppose you can simply [delete your repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/deleting-a-repository). – VonC Nov 05 '22 at 23:15