AEM 7010 · Doing Applied Economics Research: Practical Skills
2026-04-20
§ Tutorial: Why Version Control?
Version control matters in three situations every applied economist now faces.
analysis_v1.R → analysis_v2.R → analysis_FINAL_v2.R → analysis_REALLY_FINAL.R. Which version produced the coefficient in Table 2?Git is the connective infrastructure that makes all three workable.
§ Tutorial: What Is Git?
Today: Git (local). Session 5 on Wednesday: GitHub (remote).
§ Tutorial: Situations Where Git Helps
Six scenarios, each introducing vocabulary you will meet today and Wednesday.
§ Tutorial: The Three Areas of Git
Every Git project has three areas. The mental model of the entire course.
Working
Directory
git add →
Staging
Area
git commit →
Repository
The workflow: edit → stage → commit.
§ Tutorial: The Three Areas of Git
| Git | Shopping cart |
|---|---|
| Working directory | Browsing the store, dropping items in the cart |
| Staging area | Reviewing the cart at checkout |
| Repository | Your order history |
git add |
Moving an item to the checkout page |
git commit |
Clicking Place Order. Confirmation number issued. |
| Commit hash | The order confirmation number |
git log |
Your order history page |
Staging exists because you want to see exactly what you are about to commit to, before it becomes permanent.
⟶ Now switch to the tutorial: Setup, Your First Repository, Staging & Committing (~20 min hands-on)
§ Tutorial: Writing good commits
Be specific. “Fix bug” is useless. “Fix off-by-one error in sample selection” is useful.
One logical change per commit. If the message needs the word and, it is two commits.
Research changelog style:
Add control for state fixed effects
Switch to winsorized outcome at 1%
Fix sample filter for pre-2000 observations
Avoid: “Fixed stuff”, “WIP”, “Lots of changes”, “.”
⟶ Now switch to the tutorial: Exercise 1 (~5 min hands-on)
.gitignore + Undoing Mistakes§ Tutorial: .gitignore and Undoing Mistakes
Keep files out of Git with a .gitignore:
Three undo operations:
git restore --staged <file>git restore <file>git reset --soft HEAD~1Git is forgiving, but only for states it knows about. Commit often.
⟶ Now switch to the tutorial: Exercise 2 (~10 min hands-on)
Today: Git on your own laptop. Commits, staging, undoing mistakes, ignoring files.
Wednesday (Session 5): GitHub.
my-research to a GitHub repositoryBefore Wednesday: create a free GitHub account at github.com if you have not already. Questions now?
The full walkthrough with copy-paste commands, screenshots, and RStudio / VS Code equivalents is on the companion site: arielortizbobea.github.io/aem7010