Follow these steps to set up your local development environment and connect your projects to GitHub.
Before starting, make sure you have the necessary software and accounts ready.
- Visual Studio Code: https://code.visualstudio.com/download
- Git: https://git-scm.com/install/
-
Account: Sign up at GitHub.com.
-
Repository: Create a new repository on GitHub for your coursework. Reference the options in the screenshot.
Note: Make sure to copy the
HTTPS URLof the repo. You will need this when you clone locally.
Create a dedicated folder to keep your docs/code organized.
- Open Windows Explorer and navigate to
C:\. - Create a new folder and name it
GIT.
We will use Git Graph to help visualize your branches and commits.
- Open VS Code.
- Click the Extensions icon on the left sidebar (or press
Ctrl+Shift+X). - Search for Git Graph.
- Select Install. If prompted, select Trust Publisher.
This step downloads your GitHub project to your local C:\GIT folder.
-
In VS Code, open a Git Bash terminal (
Terminal>New Terminal).Note: Ensure the dropdown in the terminal panel says "Git Bash" and not "PowerShell".*
-
Navigate to your GIT folder by typing:
cd /c/GIT -
Clone your repository:
git clone [your-repo-URL] -
Open the folder in VS Code (File > Open Folder > navigate to your repo).
In this class, we follow a branching workflow. You must publish your main branch first, then create a dev branch for your work.
You must commit a file to "activate" the main branch on GitHub.
- Create a new file named
README.mdin your folder. - In the terminal, run:
git add . git commit -m "Initial commit: Setup main branch" git push origin main
Note: If you are prompted to set your Git identity, run the following commands.
git config --global user.name [Your name] git config --global user.email [Your email address]
Now, create a secondary branch where your actual development will happen.
-
Create and switch to the dev branch:
git checkout -b dev -
Open the folder: Go to
File > Open Folder, navigate toC:\GIT, and select your repository folder. -
When prompted, click
Yes, I trust the authors. -
Push the new branch to GitHub:
git push -u origin dev
Open the Git Graph view (click the Graph icon in the bottom status bar).
You should see both the main and dev branches.
Ensure the dev branch label is bold (indicating it is your active branch) before you begin working on your files.
- Invite collaborators
- Create files
- Merge changes to main
- Publish content
