Git & Version Control
Master the essential skill every software professional needs
Git is the industry-standard version control system used by developers worldwide. Whether you're working on personal projects or collaborating with teams, Git helps you track changes, manage code, and work efficiently.
Essential Commands
| Command | Description |
|---|---|
git init |
Initialize a new Git repository in your current directory |
git clone <url> |
Download a repository from GitHub/GitLab to your computer |
git add . |
Stage all changes in the current directory for commit |
git commit -m "message" |
Save staged changes with a descriptive message |
git push |
Upload your commits to the remote repository (GitHub) |
git pull |
Download latest changes from the remote repository |
git status |
Check which files have been modified or staged |
git branch |
List all branches in your repository |
git checkout -b <name> |
Create and switch to a new branch |
Branching Best Practices
-
Main/Master Branch
Keep your
mainbranch stable and production-ready. Never commit directly to main when working on teams. -
Feature Branches
Create a new branch for each feature:
git checkout -b feature/my-new-feature -
Descriptive Names
Use clear branch names like
bugfix/login-errororfeature/user-dashboard -
Regular Commits
Commit often with meaningful messages. Good: "Add user authentication". Bad: "Fixed stuff".
Learning Resources
MSUM Server Access Guide
Connect to Smoke and Alduin for your CS courses
MSUM provides three Linux servers for computer science students to develop and test server-side applications. These servers are essential for many CS courses including Server-Side Scripting, Network Programming, and Database courses.
💨 Smoke
smoke.minnstate.edu
🐲 Alduin
alduin.minnstate.edu
Setup Instructions
-
Install Microsoft Authenticator
Download Microsoft Authenticator on your phone from the App Store (iOS) or Google Play (Android). You'll need this for two-factor authentication.
-
Enable MFA on your MSUM Account
Visit aka.ms/mfasetup and sign in with your MSUM credentials (StarID@go.mnstate.edu).
Follow the prompts to add Microsoft Authenticator as your authentication method.
-
Generate SSH Keys (First Time Only)
Open your terminal (PowerShell on Windows, Terminal on Mac/Linux) and run:
ssh-keygen -t rsa -b 4096Press Enter to accept the default file location. You can set a passphrase or leave it empty (press Enter twice).
📁 Note: Your SSH keys will be saved in~/.ssh/directory. The public key isid_rsa.puband the private key isid_rsa. Never share your private key! -
Copy Your Public Key
Display your public key with this command:
cat ~/.ssh/id_rsa.pubCopy the entire output (starts with
ssh-rsaand ends with your email/computer name). -
Connect to Broker Server
First, you must connect through the broker server. This is a security gateway:
ssh StarID@broker.mnstate.eduReplace
StarIDwith your actual MSUM StarID (lowercase). For example:ab1234cd@broker.mnstate.eduYou'll be prompted for:
- Your MSUM password
- Microsoft Authenticator approval (check your phone)
-
Add SSH Key to Authorized Keys (One Time Setup)
Once connected to broker, create the SSH directory if it doesn't exist:
mkdir -p ~/.ssh
chmod 700 ~/.sshThen add your public key to authorized_keys:
echo "YOUR_PUBLIC_KEY_HERE" >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keysReplace
YOUR_PUBLIC_KEY_HEREwith the public key you copied in step 4. -
Connect to CS Servers
From the broker server, you can now SSH to any CS server:
# Connect to Smoke
ssh smoke.mnstate.edu
# Or Alduin
ssh alduin.mnstate.eduSince you've set up SSH keys, you won't need a password!
Quick Reference
# 1. Connect to broker (requires password + MFA)
ssh StarID@broker.mnstate.edu
# 2. From broker, connect to a CS server (no password needed)
ssh smoke.mnstate.edu
# 3. Do your work on the server
# 4. When done, disconnect:
exit # exits from CS server back to broker
exit # exits from broker
- If you can't connect, make sure you've enrolled in MFA at aka.ms/mfasetup
- Use lowercase for your StarID
- If SSH keys don't work, verify permissions:
chmod 600 ~/.ssh/authorized_keys - Need help? Come to ACM office hours or ask on Discord!
WSL Setup for Windows
Run Linux natively on your Windows machine
Windows Subsystem for Linux (WSL) lets you run a complete Linux environment directly on Windows without dual-booting or virtual machines. This is essential for CS students who need Linux tools for development, testing, and coursework.
Why Use WSL?
Access bash, gcc, python, and other Linux utilities directly on Windows
Much faster than virtual machines with less resource usage
Access Windows files from Linux and vice versa seamlessly
Installation Steps
-
Check Windows Version
You need Windows 10 version 2004+ (Build 19041+) or Windows 11. To check:
Press
Win + R, typewinver, and press Enter. -
Install WSL (Easy Method)
Open PowerShell as Administrator (right-click Start → Windows PowerShell (Admin)) and run:
wsl --installThis single command will:
- Enable WSL and Virtual Machine Platform features
- Download and install Ubuntu (default Linux distribution)
- Set up everything automatically
Restart your computer when prompted.
-
Set Up Ubuntu
After restart, Ubuntu will launch automatically. You'll be asked to:
- Create a username (can be different from your Windows username)
- Set a password (you won't see characters as you type - this is normal!)
⚠️ Important: Remember this password! You'll need it for sudo commands. -
Update Your System
Once setup is complete, update Ubuntu packages:
sudo apt update && sudo apt upgrade -y -
Install Essential Development Tools
Install build-essential (includes gcc, g++, make):
sudo apt install build-essential git curl wget -y
Using WSL
wsl
# Or search for "Ubuntu" in Windows Start menu
# Access Windows files from WSL:
cd /mnt/c/Users/YourName/Documents
# Access WSL files from Windows:
# In File Explorer, type: \\wsl$\Ubuntu\home\yourusername
# Install packages:
sudo apt install package-name
# Exit WSL:
exit
Useful WSL Commands
| Command (PowerShell) | Description |
|---|---|
wsl |
Start your default Linux distribution |
wsl --list |
List all installed Linux distributions |
wsl --shutdown |
Shut down all running distributions |
wsl --update |
Update WSL to the latest version |
wsl --install -d <distro> |
Install a different distribution (e.g., Debian, Kali) |
Recommended VS Code Setup
-
Install VS Code
Download from code.visualstudio.com
-
Install WSL Extension
In VS Code, install the "WSL" extension by Microsoft. This lets you develop directly in WSL.
-
Open Projects in WSL
From WSL terminal, navigate to your project and type:
code .VS Code will open with full WSL integration!
- Store your projects in WSL file system (
~/projects) for better performance - Use Windows Terminal for a better command-line experience
- Install zsh and oh-my-zsh for a prettier terminal
- WSL 2 is automatically installed with
wsl --installand offers the best performance