Fork Using Command Line
Step 1: Open the terminal or gitbash and type the below command.
gh --version
If it displays the version like in the image below, then the GitHub ClI was already set up on our computer. If not, use this link to set it up. “https://cli.github.com/”
Step 2: You must first log in using the CLI to GitHub using your GitHub account before you may fork the repositories. To do it, issue the following command.
gh auth login --web > SSH
Open the CLI-provided link, then enter your one-time code in the Chrome browser.
Step 3: Once authentication is done. Copy the Repo URL that you to fork into our repo and use the below command.
gh repo fork <REPO URL> --clone
— clone is used to get rid of the hurdles in between Fork. That is how we may use the CLI to fork the repository.
Git – Fork
Forking a repository means creating a copy of the repo. When you fork a repo, you create your own copy of the repo on your GitHub account. When several developers want to work on a project but need to make changes that are inappropriate for the original repository, forking is frequently used in open-source software development.
In this article, we will learn more about Git-Fork and its uses.
Table of Content
- What is Git Fork?
- Reasons For Forks
- Steps to Forking A Repository
- Fork Using Command Line
- Difference between Git Fork vs Git Clone
- How To Decide Between A Git Clone And Fork?
- Configuring Git To Sync Your Fork with the Upstream Repository
- Conclusion