|
| 1 | +--- |
| 2 | +weight: 1 |
| 3 | +bookFlatSection: true |
| 4 | +title: "6. Clone GitHub Repository" |
| 5 | +--- |
| 6 | + |
| 7 | +# Clone GitHub Repository |
| 8 | + |
| 9 | +Once you have read access to the course repository, you would need to clone the repository to your local machine. |
| 10 | + |
| 11 | +Before we can do that, we need to setup your local machine's authentication with Github. |
| 12 | + |
| 13 | +There are many ways to do this. |
| 14 | + |
| 15 | +## GitHub Authentication Option 1: SSH |
| 16 | + |
| 17 | +Follow the official docs to setup SSH authentication: |
| 18 | + |
| 19 | +1. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent |
| 20 | +2. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account |
| 21 | + |
| 22 | +Using SSH keys is the preferred method by most companies in the industry as it is more secure by making use of public key cryptography. It would be a good chance for you to learn how to do this if you haven't before. |
| 23 | + |
| 24 | +The idea is that you would upload a "public" key to Github and you keep a "private" key in your machine. That means if you leak your public key, it is very difficult for an attacker to brute force and crack your private key (assuming you keep your private key safe and secure). At the time of writing, brute forcing a key of 4096 bits will take years that can even take longer than our lifetimes in this world. |
| 25 | + |
| 26 | +With this method, clone the repository using the ssh method: |
| 27 | + |
| 28 | +```sh |
| 29 | +$ git clone [email protected]:Data-Engineer-Camp/ <yyyy><mm >-bootcamp.git |
| 30 | +``` |
| 31 | + |
| 32 | +## GitHub Authentication Option 2: Personal access tokens |
| 33 | + |
| 34 | +Follow the official docs: |
| 35 | + |
| 36 | +1. https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens |
| 37 | + |
| 38 | +This is the simplest and easiest way to manage authentication with Github. However, you should treat your access tokens as passwords because if it gets leaked, an attacker would have full access to your account. |
| 39 | + |
| 40 | +This is the least preferred method, only do this if you are having issues with the previous option. |
| 41 | + |
| 42 | +With this method, clone the repository using the https method: |
| 43 | + |
| 44 | +```sh |
| 45 | +$ git clone https://github.com/Data-Engineer-Camp/<yyyy><mm>-bootcamp.git |
| 46 | +Username: YOUR_USERNAME |
| 47 | +Password: YOUR_PERSONAL_ACCESS_TOKEN |
| 48 | +``` |
| 49 | + |
| 50 | +## Pulling updates from the repo |
| 51 | + |
| 52 | +After every lecture, we will be uploading the solved student solutions. |
| 53 | + |
| 54 | +To pull updates from the repository: |
| 55 | + |
| 56 | +```sh |
| 57 | +git pull origin main |
| 58 | +``` |
| 59 | + |
| 60 | +{{< button relref="/docs/5-setup-github" >}}« Previous{{< /button >}} {{< button relref="/docs/7-intro-presentation" >}}Next »{{< /button >}} |
0 commit comments