Follow the steps below to create your GitHub account and first respository, download and install VS Code, and make your first commit into your repository.
-
Start at GitHub.com.
-
Click sign up in the upper-right.
-
Complete the form to set up your github username.
- IMPORTANT: Choose your username wisely! It will be visible as when you share your repository.
-
From the upper-right click on the plus and choose New Repository
-
Enter the following:
- A repository name - something like IntroToCs.
- Choose Private
- Check the Add a README file checkbox
-
Click the Create Repository button.
Since this repository is private you will need to add me as a collaborator so I can see your homework assignments.
-
From within your respository, click on the Settings in the upper toolbar.
-
Then click the Manage Access menu option on the left.
-
Then from the center panel click the Invite a Collaborator button.
-
Enter my email address in the modal dialog that pops up and then click the Add to Repository button.
-
You should see the pending invite under the Manage Access section.
- Download and Install Git from https://git-scm.com/download.
- Download and Install Visual Studio Code from https://code.visualstudio.com/.
-
Open Visual Studio Code.
-
Click on the Explorer icon in the left side tool bar (the one that looks like two sheets of paer on top of each other) or use the Ctrl+Shift+E hotkey to open the Explorer window.
-
Click the Clone Repository button.
-
Enter the url to the repository that you just created. It will be something like
https://github.com/[USERNAME]/IntroToCs
-
Select a folder to clone the GitHub repo locally.
-
Browse to the folder on your computer to confirm you see the files on your computer (and to associate that this folder on your computer matches the GitHub Repository).
-
Open Visual Studio Code.
-
On the VSCode left side tool bar there are icons for the Explorer and for Source Control (or GitHub).
-
Click the Explorer icon to open to show your files in your repository that you just cloned.
- If you do not have a folder open, then click the Open Folder button and select the folder on yoru computer where you cloned your repository.
-
In the Explorer panel, click on the README.md file. The contents will load to the right.
- You can see a preview of your page by clicking the Preview button at the top of the README.md.
-
Make a change to the readme by editing the README.md file in the center panel. Add your name. Then put your first name in bold and your last name in italics using markdown formatting.
-
Save the file (Ctrl+S).
-
Open the Source Control panel by clicking the Source Control button in the left side toolbar.
-
Under the Changes section, stage the change by clicking the '+' button next to the README.md file.
-
Commit the change by entering a comment in the textbox and then clicking the commit checkbox in the source control toolbar.
-
NOTE: You may get an error at this point where you need to set your Git email and name. To do this, open Terminal and paste and run the following commands (putting in your own email and name). And then repeat the prior set to commit your changes.
git config --global user.email "youremail@gmail.com"
git config --global user.name "your name"
-
Finally push the changes up to your repository by clicking the menu button in the source control toolbar '...' and then selecting push.
-
To confirm your changes are now on your repository, visit your repository at github.com to see that the change is there.
![VSCode First Commit](/images/vscode-my-first-commit.png)