简体   繁体   中英

Remotely Fork Github Repository

From my local machine ( Windows 10 ) using the command-line, can I fork someone else repository without having to use the Fork button on the site?

Use Case

I'm wanting to create a setup script that forks a repository remotely on Github to a remote Github repository within my account, then git clone the forked repository to my local machine.

Unfortunately, "Forking" is not actually a git function.

By this I mean that without extra plugins or scripts, git by itself does not have a function "fork", nor does it know how to ask the remote how to do a fork.

Instead, this is purely a function that the hosting partner provides, usually through its web user interface.

However, GitHub have a REST API , and with it you can instruct GitHub to manage forks .

As such, I think your best way forward would be to either find a script or plugin or program that asks GitHub to do this fork, or build one yourself using this REST API.

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