> For the complete documentation index, see [llms.txt](https://johnoraw.gitbook.io/iac-version-control/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://johnoraw.gitbook.io/iac-version-control/github/the-basics/forks.md).

# Forks

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>                                            |
| :-----------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------: |
| <img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/tX0A4v7VuKIkaAKOEgYn/image.png" alt="" data-size="original"> | <img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/aBBoOT46Qnk1xgb4sF8U/image.png" alt="" data-size="original"> |

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

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/3dWFaoPSaLL4RLVhMf1u/image.png" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/OF9U60g1beKO53waP57X/image.png" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/H8X6MTFl4MPtimSudH4P/image.png" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/opRFT3L11kdJbeZNL6um/image.png" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://content.gitbook.com/content/C1tv1gDCmQOVxTprzQP4/blobs/J0yw36EdLgoBr36vu7nq/image.png" alt=""><figcaption></figcaption></figure>

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.&#x20;

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&#x20;

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