2 min read
Git
For saving progress, undoing mistakes, and managing versions.
Saving Progress
Commit current progress
Commit the current progress with a message describing what we just did.
Set up git from scratch
Set up git for this project — initialize the repo, create a .gitignore, and make the first commit.
Check what changed
What has changed since the last commit? Show me a summary.
Undoing Mistakes
Undo the last change
The last change broke things. Undo it and go back to the previous working state.
Undo changes to one file
I only want to undo the changes to [file]. Keep everything else.
Discard all uncommitted changes
I haven't committed yet but I want to start over on this feature. Discard all uncommitted changes.
Working with GitHub
Push to GitHub
Push this project to a new GitHub repository.
Pull latest changes
Pull the latest changes from GitHub.
Create a branch
I want to try something experimental without messing up the working version. Create a branch called [name].
Understanding History
Show recent commits
Show me the last 5 commits — what changed and when.
Check when a file changed
When did [file] last change? What was the change?
Find which commit broke something
Something broke recently. Help me find which commit caused it.
Tips
- Commit often — every time something works, save it
- Think of commits like save points in a game — you can always go back
- Write commit messages that describe what you did, not how (e.g., “Add dark mode” not “Change CSS variables”)
- See the Git for Designers guide for a deeper introduction