How to disable fork on private repo on github

后端 未结 3 2016
执笔经年
执笔经年 2021-01-07 20:07

It was easy on bitbucket. if I dont want my repo to be forked. I can disable it. Only people I have invite can work on repo as long as they have permission on repo.

相关标签:
3条回答
  • 2021-01-07 20:28

    GitHub doesn't have such a feature as Bitbucket has, but still, you can't make fork from a private repository public. You'll see this message:

    Private forks can't be made public.
    

    It gives you a "fool protection" when somebody want's to publish your private repo. Of course, if somebody really want's to do this, they always can push all the code to some new repo as @Chris stated above.

    0 讨论(0)
  • 2021-01-07 20:31

    I'm not aware of any way to do this in GitHub, and frankly I don't see any value in Bitbucket letting you "disable" forking, either.

    Bitbucket may let you disable the fork button, but anybody who can clone your repository can "fork" it by simply pushing it up to a different remote:

    git clone git@bitbucket.org:alix/some-repo.git
    git remote set-url --push origin git@bitbucket.org:chris/some-repo.git
    git push origin master
    
    0 讨论(0)
  • 2021-01-07 20:42

    Github has this functionality now. See Github's howto -- note that (as requested by OP) this is only available for private repos

    To access this setting you must be signed in as an organization owner or as a repo admin. Navigate to your repo > Settings > Options and uncheck "Allow forking"

    0 讨论(0)
提交回复
热议问题