Setup Git in VS Code

✅ Step 1: Sign Up or Sign In to GitHub and install Git

  1. Sign in to your GitHub account or create a new one at https://github.comarrow-up-right.

  2. Open VS Code.

  3. Click on the profile icon at the bottom left.

  4. 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

  1. Click on this link to accept the Python assignment: https://classroom.github.com/a/sY6KtRotarrow-up-right

  2. On the opened page, click the blue link to navigate to your repository.

  3. 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

  1. Press Ctrl+Shift+P (or CMD+Shift+P)

  2. Search for and select Git: Clone or Clone Repository

  3. Select Clone from GitHub.

  4. Paste the repository URL from Step 2.

  5. Choose a local folder to save your project.

  6. 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:

  1. In the Explorer panel (left sidebar), click on Notebook_Template.ipynb.

  2. Then, look at the top right corner of the notebook. You will see the current Python version displayed.

  3. Click on it, because we want it to select our virtual environment instead.

  4. 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:

  1. Click on requirements.txt

  2. Then press OK.

Wait for the installation to complete (progress is shown in the bottom right corner).

Setup Complete!


✅ Step 5: Make Your First Commit

  1. Open Notebook_Template.ipynb and make some changes (e.g., add your name).

  2. Go to the Source Control tab (left sidebar).

  3. Enter a commit message, then click Commit.

  4. 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