“Piled Higher and Deeper”, http://www.phdcomics.com
Changes are saved sequentially.
Different versions can be tracked simultaneously.
# Configure your identity
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
# Configure your editor
git config --global core.editor "vim" # or "nano -w", "emacs"Note
These settings are used to track who made which changes
The Git staging area.
git addgit commitLet’s Practice!
Follow along with these commands in your terminal
# Create and navigate to project directory
cd ~/Desktop
mkdir crypto_notes
cd crypto_notes
# Initialize git repository
git init
# Switch to main branch
git checkout -b main.git directory
What do you see when you run ls -a?
# Create a new file
echo "Public key cryptography relies on mathematical problems that are easy to compute in one direction but difficult to reverse" > rsa_notes.txt
# Check status
git status
# Stage the file
git add rsa_notes.txt
# Commit with message
git commit -m "Initial notes on public key cryptography fundamentals"Commit Messages
The Git Commit Workflow
git add)git commit)Practice Time
rsa_notes.txtgit diffEdit rsa_notes.txt again:
Check status and differences
Stage and commit
Warning
Remember: you can always check status with git status
Essential Git Commands:
git status # Check repository status
git add <file> # Stage changes
git commit -m "" # Commit with message
git log # View history
git diff # View changesTip
Keep this slide handy for future reference!
The Git Staging Area
Earth System Data Science in the Cloud