223.2 Setting up the development environment

Set up your project folder, version control, and GitHub connection from your IDE’s terminal.

Once your project folders are in place, you’re ready to configure version control using Git. This section guides you through setting up a local Git repository, creating an SSH key for secure authentication, and pushing your code to GitHub.

You’ll use your IDE’s built-in terminal to run Git commands. This workflow mirrors what professional developers use, ensuring that your progress is tracked, backed up, and ready for collaboration.

Initialising Git in your project folder

In your IDE’s terminal, make sure you are inside your project folder (e.g. task-tracker/) and run:

git init

This creates a hidden .git folder and prepares your project for version control.

Optionally, you can create a .gitignore file to exclude unnecessary files:

echo "__pycache__/" >> .gitignore
echo "*.pyc" >> .gitignore
git add .gitignore

Configuring Git (first time only)

Set your Git author identity (if not already configured):

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

This information will appear in your commit history.

Creating an SSH key for GitHub

An SSH key pair is an advanced security feature that enables your computer to securely connect to GitHub without requiring you to enter your username and password each time. The private key stays safely on your device, while the public key is added to your GitHub account. When you push code, GitHub uses these keys to verify your identity and automatically and securely authorise the connection.

If this is your first time connecting to GitHub with SSH, generate a new private key for your device:

ssh-keygen -t ed25519 -C "[email protected]"

Press Enter to accept the default file name. Then start the SSH agent and add your key:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

Run this line to display the public key, and then copy and paste it into GitHub, name the key pair appropriately:

cat ~/.ssh/id_ed25519.pub

This sequence of commands in the terminal:

  • Creates a private key (usually at ~/.ssh/id_ed25519)

  • Creates a matching public key (at ~/.ssh/id_ed25519.pub)

  • Displays the public key for addition to GitHub

  • The -C option adds an identifying comment (usually your email)

It's important to note that:

  • The private key stays on the user’s computer and should never be shared.

  • The public key is safe to copy to GitHub, where it’s used to verify future connections from that specific device.

If you wish to work on your project on another device via GitHub, you must generate another unique SSH public/private key pair for that device. The key pair is device-dependent.

Connecting your project to GitHub

On GitHub, create a new empty repository (without README or .gitignore). Then return to your terminal and link it:

git remote add origin [email protected]:YourUsername/task-tracker.git

Set the branch name:

git branch -M main

Now push the code:

git add .
git commit -m "Initial commit with project structure"
git push -u origin main

You are now ready to begin Sprint 1 with your project under version control.

Last updated

Was this helpful?