Setup Git in VS Code
✅ Step 1: Sign Up or Sign In to GitHub and install Git
Sign in to your GitHub account or create a new one at https://github.com.
Install Git: https://git-scm.com/downloads
Open VS Code.

Click on the profile icon at the bottom left.

Select Sign in with GitHub and follow the prompts.

If you don't see the option to sign in, that's alright. Proceed with the next step and you'll be asked to sign in later.
✅ Step 2: Accept the Git Assignment
Click on this link to accept the Python assignment: https://classroom.github.com/a/sY6KtRot
On the opened page, click the blue link to navigate to your repository.
Click the green Code button
and copy the HTTPS URL. (we'll use this in the next step)
✅ Step 3: Clone the Repository to Your Computer
Press
Ctrl+Shift+P(orCMD+Shift+P)Search for and select
Git: CloneorClone RepositorySelect Clone from GitHub.
Paste the repository URL from Step 2.
Choose a local folder to save your project.
VS Code will automatically open the project.
✅ Step 4: Create a Virtual Environment
To run Python code in a Jupyter Notebook (.ipynb), create a virtual environment and configure the Notebook to run with it.
You can either do this using either PowerShell commands or the VS Code functions. Choose your own poison :)
🐍 Create Virtual Environment:
In the Explorer panel (left sidebar), click on Notebook_Template.ipynb.
Then, look at the top right corner of the notebook. You will see the current Python version displayed.
Click on it, because we want it to select our virtual environment instead.
A search bar will pop up & Python will ask you to choose a Kernel:
Select: Python Environments -> Create Python Environment -> Venv -> Python 3.xx.x (your python version)


📦 Install Dependencies:
Next, install the the required packages:
Click on requirements.txt
Then press OK.

Wait for the installation to complete (progress is shown in the bottom right corner).
✅ Setup Complete!
🐍 Create Virtual Environment
Open a new terminal by clicking on the tab Terminal -> New Terminal
The terminal will open at the bottom of VS Code, pointing to your project folder.
In the terminal, run the following command:
This will create a folder named
venvin your project directory.venvcontains all the isolated Python packages.If you get an execution error, try running this script first in
Powershell (on Windows):
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope ProcessBash (Mac or Linux):
chmod +x venv/bin/activate
More details in Troubleshooting
Now activate the virtual environment:
For Windows (PowerShell):
For Windows (CMD):
For macOS/Linux:
When activated, your terminal prompt should show
(venv), indicating that you are inside the virtual environment.
Configure the Notebook with the Virtual Environment
If this notification pops up, click Yes
If not:
In the Explorer panel (left sidebar), click on Notebook_Template.ipynb.
Then, look at the top right corner of the notebook. You will see the current Python version displayed.
Click on it, select venv instead:
📦 Install Dependencies from requirements.txt
If you have a requirements.txt file, run in the terminal:
This command reads all dependencies listed in
requirements.txtand installs them in your virtual environment.
✅ Step 5: Make Your First Commit
Open Notebook_Template.ipynb and make some changes (e.g., add your name).
Go to the Source Control tab (left sidebar).

Enter a commit message, then click Commit.
Click Push to sync your changes with GitHub.
Well done! Your changes is now online on your GitHub repository! 🎉
🎉 You’re all set! You now have Python, VS Code, and GitHub working together for a productive and beginner-friendly coding workflow.
Last updated







