A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
Where the world builds software
“Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.”
-> https://github.com/
“Focus on what matters instead of fighting with Git. Whether you’re new to Git or a seasoned user, GitHub Desktop simplifies your development workflow.”
-> https://desktop.github.com/
Github.com and github desktop will work together to make your packages and pages go live!
Most commonly, forks are used to either propose changes to someone else’s project or to use someone else’s project as a starting point for your own idea. You can fork a repository to create a copy of the repository and make changes without affecting the upstream repository.
Propose changes to someone else’s project
For example, you can use forks to propose changes related to fixing a bug. Rather than logging an issue for a bug you’ve found, you can:
- Fork the repository.
- Make the fix.
- Submit a pull request to the project owner.
-> We will be forking this project: https://github.com/octocat/Spoon-Knife
Step 1: Copy the url to the example project we will be using.
Step 2: Go to your Github Desktop, under ‘File’ choose ‘Clone Repository’. Paste the link and choose the path (file) you want your new project to be stored in.
Step 3: In your documents find and open the folder ‘Spoon-Knife’. Open the ‘index’ folder, delete the text and write ‘my first fork!!’.
Step 4: In the Github Desktop you will see changes have appeared. In the summary box write ‘update’ and click ‘commit to main’.
Step 5: Click ‘push origin’ and it will send your work back to the github webpage.
Let’s take a look at our new fork!
Return to the github page, top right corner click on your account and select ‘Your repositories’. Next, click on ‘Spoon-Knife’.
Top right click on ‘settings.
Scroll down to ’Github Pages’, and click on ‘Check it out here!’.
Under source select ‘main’ and click save. Your site is now published!
Copy the link and go back to ‘Code’ tab.
In the ‘about’ click on setting and add your new link under ‘website’. Now you can click on that link whenever you make changes you want to see!
You’re all done! Celebrate good times, come on!
Note: It may take a few minutes for the codes to update, refresh your page and try the link again if no changes appear.
For more information about forking, visit: https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks
Guide for forking projects: http://guides.github.com/overviews/forking/
This code through references and cites the following sources:
github.com
desktop.github
docs.github.com/en/get-started/quickstart/fork-a-repo