git: Version Control from the Command Line
Get fluent with the git command line — initialise a repo, stage and commit changes, read status and diffs, branch and merge, undo mistakes, and connect to a remote, one small command at a time.
Almost every developer uses git, but most learned it as a handful of memorised incantations and never built a mental model. This course starts from an empty folder and grows a tiny notes project, introducing one git command at a time and explaining exactly what each one does and why. You'll learn to read git's output instead of fearing it — the status codes, the commit hashes, the branch marker, the diff signs — and you'll practise the everyday loop of edit, stage, commit. By the end you can branch and merge, stash work in progress, undo a commit you didn't mean to make, and push to a remote. Writing a file and running the git command on it are kept as separate steps, so each idea lands on its own.
What you'll build
- Initialise a repository and configure your identity
- Stage and commit changes, and read status and the log
- Inspect what changed with diff and show
- Branch, switch, and merge work together
- Ignore files, stash work, tag releases, and undo a commit
- Connect a repository to a remote and push
Contents
- Start a repository
- Tell git who you are
- Set your email too
- Create the first file
- Check the status
- Stage the file
- See what's staged
- Make the first commit
- Read the history
- Change a tracked file
- See what changed
- Commit the change
- List the branches
- Start a branch
- Work on the branch
- Commit on the branch
- Switch back
- Merge the branch
- Picture the history
- Ignore some files
- Watch the noise vanish
- Stage and inspect it
- Diff the staged version
- Commit the ignore rules
- Start something half-finished
- Stash the work away
- Bring it back
- Throw away an edit
- Look at one commit
- Tag a release
- List the tags
- Add a remote
- Push your work
- Pull from the remote
- Undo the last commit
- Clone an existing project
- Where to go from here