Git & GitHub: A Beginner’s Guide to Version Control for Data Professionals
Source: Dev.to
Installing Git
Windows Users
- Visit the Git for Windows download page.
- Download the Windows installer.
- Run the installer with these recommended settings:
- Select “Use Git from Git Bash only”.
- Choose “Checkout Windows‑style, commit Unix‑style line endings”.
- Use MinTTY as the terminal emulator.
- Enable file system caching.
macOS Users
brew install git
Linux Users
# Debian/Ubuntu
sudo apt-get install git
# CentOS/Fedora
sudo yum install git
Verify Installation
git --version
Configure Git
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Generate SSH Key
ssh-keygen -t rsa -b 4096 -C "your.email@example.com"
- Press Enter to accept the default file location.
- Create a passphrase when prompted.
View your public key:
cat ~/.ssh/id_rsa.pub
Copy the entire output.
Add SSH Key to GitHub
- Go to GitHub → Settings → SSH and GPG keys → New SSH key.
- Paste your key and save.
Test Connection
ssh -T git@github.com
You should see a message like:
Hi username! You've successfully authenticated...
Understanding Version Control: The What & Why
What is Version Control?
Think of it as a time machine for your code. Every change is saved, so you can:
- Track who made what changes.
- Revert to previous versions.
- Work on features without breaking your main code.
- Collaborate without overwriting others’ work.
Why Data Professionals Need Git
- Reproducibility: Track exactly which version of code produced which results.
- Collaboration: Multiple team members can work on the same project simultaneously.
- Experimentation: Try new approaches without fear of breaking working code.
- Documentation: Commit messages explain why changes were made.