IAC - Version Control
GITHUB
GITHUB
  • Background
  • Setting up GitHub
  • Windows
    • Working with a cloned repo
    • Populating a repo from local files
    • Integrate VSCode
  • Linux
    • Using SSH
    • GH Command Line
  • The Basics
    • Forks
    • Logs
    • Undoing Local Changes
  • Larger Projects
    • Setting up a repo
    • Creating my Branch Architecture Locally
    • Creating a Feature Branch
    • Creating my Branch Architecture on GitHub
    • Merging the changes from GitHub on my local machine
    • Merging the changes from my local machine to GitHub
    • Sync the branches in GitHub
  • Finally
Powered by GitBook
On this page
  1. The Basics

Forks

PreviousThe BasicsNextLogs

A GitHub fork is unique to GitHub, it does not exist in GitHub. Whenever someone creates a public repository, you can copy it over to your own account. This is one of the huge advantages of GitHub. After you fork, there is no link between the two, you will not get any future updates from the original repo.

Sometimes we copy an entire repo to our own account. In this example, I am working with two repos that I have. We have already created some material on one of them.

https://github.com/JohnORaw
https://github.com/GreatlyImprovedTechnology

In the JohnORaw repo, I can search for the repo I want to copy using the search bar.

If I click on this, I can see the public repository. There is a fork button.

If I click the fork button, an exact copy of this repo is made to my JohnORaw GitHub account, at this point in time.

Everything was copied. Examine the commits which have been made.

This shows me the commit history (these screenshots from November 2022).

The original repo could have reverted to earlier versions and earlier commits, so can I in the forked repo. I can see the hash associated with each version.

I may have only had read/public access to the original repo, I could not have made changes. But once I clone the repo, its mine, I have full rights to make changes. 

Exercise

Work with another student in the class and fork one of their public repos.