(Part 6 of series Blueprint for a Modern Research Computing Environment)
Follow me :
This article installs and configures Git, connects your machine to GitHub over SSH, and pushes project_1 as your first repository. It closes with the everyday four-command Git workflow you’ll use from here on, plus a map of what else Git and GitHub offer — branching, pull requests, forking, Issues, and Actions.
You’ve been writing code. It works. You change something — now it doesn’t. You don’t remember what you changed. Sound familiar? Now imagine two people editing the same script. Who has the latest version? What did the other person change? How do you combine your work without overwriting each other?
These are not hypothetical problems. Every researcher who writes code eventually faces them. Git is the solution, tracking every change you make to your code. GitHub is where you store that history online — making your code accessible from anywhere, shareable with collaborators, and safe from your hard drive failing.
By the end of this part, you’ll have:
project_1 pushed to GitHub as your first repositoryAI tools (like Claude, Grok, Gemini, or ChatGPT) give the best troubleshooting advice when they have the exact text of the tutorial. To ensure the AI understands what you are trying to build, we will give it the actual file.
1. Download the tutorial file
2. Upload it to your AI
Part6.md into the chat).3. Ask for Help Copy and paste this exact prompt into the chat along with your file:
I have attached the markdown file for the tutorial I am following. Please read it so you understand the specific environment I am trying to build.
I need help with the following:
Step [X]: [paste exact step text from the blog]
Command I ran: [paste exact command]
What happened: [paste full output/error — if the terminal was truly blank, say so explicitly]
Please help me troubleshoot and fix this error. You can use your general knowledge to solve the problem, but your solution MUST align with the architecture and tools taught in the attached file. Do not suggest alternative setups that contradict the tutorial. Once fixed, tell me what to do next in the article.
To go deeper on a step before you run a command:
I have attached the
Part6.mdfile. Look at Step [X] and explain exactly what the command does and why we are doing it before I run it.
Think of this series as the roadmap and your AI assistant as your learning companion.
~/project_1 folder with files created (Part 3, Part 4, and Part 5)Go to https://github.com and sign up for a free account. Choose your username carefully — it will be visible on every repository you create.
Open your terminal and type:
sudo apt update
sudo apt install git
Verify:
git --version
Tell Git who you are:
git config --global user.name "Your Name"
git config --global user.email "your_email@example.com"
Set VS Code as your default Git editor:
git config --global core.editor "code --wait"
Generate a key specifically for GitHub:
ssh-keygen -t ed25519 -C "your_email@example.com"
When asked where to save it, type ~/.ssh/id_ed25519_github to avoid overwriting existing keys. Set correct permissions:
chmod 600 ~/.ssh/id_ed25519_github
Copy your public key:
cat ~/.ssh/id_ed25519_github.pub
Add it to GitHub:
Tell SSH which key to use:
nano ~/.ssh/config
Add these lines:
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_github
Test the connection:
ssh -T git@github.com
project_1project_1 to GitHubNavigate to your project folder:
cd ~/project_1
git init
Create a .gitignore file to exclude temporary files:
nano .gitignore
Add these lines:
__pycache__/
*.pyc
.ipynb_checkpoints/
Stage and commit:
git add .
git commit -m "Initial commit: project_1 setup"
Connect to GitHub and push:
git remote add origin git@github.com:yourusername/project_1.git
git branch -M main
git push -u origin main
Every time you make changes, follow this workflow:
git statusgit add .git commit -m "Describe what you changed"git pushTo download an existing project:
git clone git@github.com:yourusername/project_1.git
Beyond basic pushes, explore these features:
What You’ve Done:
project_1 to GitHubNext: Part 7 — Project Organization and Managing Scientific Data | Previous: Part 5 — Linux Essentials