3.6. Create a Git Repo#

In this lab you’ll form my GitHub repo with starter code and clone your fork into your development environment. Some of the project milestones will require a URL to this repository so that I can visit it with my browser. GitHub uses git to manage your code and keep it safe with features to help collaborate with other people. GitHub also builds your Docker containers automatically for you.

Before You Begin#

You should have already have a GitHub account that has your SSH key and you should have configured git’s settings. Before you begin veriy that you can connect to GitHub in your dev environment:

Attention

If you get the “Are you sure…” message answer “yes”

$ ssh -T git@github.com> 
The authenticity of host 'github.com (192.30.255.112)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
                                                                     ^^^

You should see this as the last line of the output:

Hi USERNAME! You've successfully authenticated, but GitHub does not provide shell access.

Error

If you see this:

git@github.com: Permission denied (publickey).

verify that you have uploaded your SSH key as shown in the 2. Accounts and Keys lab.

Also verify that you have configured git:

$ git config --global user.name
Your Name
$ git config --global user.email
you@you.com

Error

If you don’t see any output from the git command set your git name and email as shown in the 2. Accounts and Keys lab.

Fork my Repository#

Follow GitHub’s instructions on how to Fork a repo. My repository can be located here:

Step 4: Clone Your Fork#

After you have forked my repository your copy will be available in your account. Follow the instructions on Cloning a repository on GitHub’s site.

Your repsoitory will have a green “Code” button. Press it and copy a GIT link that will look something like this:

SSH clone URL

Important

Verify that your link starts with git@ NOT https://

In the home directory of your cloud shell run the command:

$ git clone your-url-here

You should see a new cis-92 directory. Open that directory in your cloud editor.

Open Your Repo#

Whether you are using vscode or Cloud Shell Editor open the new dirctory using the File -> Open Folder menu option. With just your project folder open you should only see the README.md file and the .git directory in your file panel on the left. If you see other files (e.g. .bashrc) stop and repeat the “Open Folder” dialog until your editor only shows the correct environment.