Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

egghead.io

Fix Common Git Mistakes

via egghead.io

Overview

This workshop will start by breaking down the four states in which a file can exist, and we'll build up our mental model of git from there. Then, we'll look at how to move files between those states in different ways.
Once we've developed a new model for how git operates, we'll be able to purposefully get ourselves into some sticky situations, and then gracefully recover from them.
If you can handle git add/commit/push, but not much more - then this workshop is perfect for you.
You can finally get some proper git training, and will never have to worry about losing data or messing up the repo again!

Syllabus

  • Change a Commit Message that Hasn't Been Pushed Yet
  • Add More Files and Changes to a Commit Before Pushing
  • Remove Files from Staging Before Committing
  • Remove Changes from a Commit Before Pushing
  • Use and Compare the Different git Reset Options: --hard, --soft, and --mixed
  • Recover Local Changes from `git reset --hard` with `git reflog`
  • Undo a Commit that has Already Been Pushed
  • Push a New Branch to github that Doesn't Exist Remotely Yet
  • Copy a Commit from One Branch to Another
  • Move a Commit that was Committed on the Wrong Branch
  • Use `git stash` to Save Local Changes While Pulling
  • Explore Old Commits with a Detached HEAD, and then Recover
  • Fix a Pull Request that has a Merge Conflict
  • Cleanup and Delete Branches After a Pull Request
  • Change the Commit Message of a Previous Commit with Interactive Rebase
  • git Ignore a File that has Already been Committed and Pushed
  • Add a File to a Previous Commit with Interactive Rebase
  • Fix Merge Conflicts While Changing Commits During an Interactive Rebase
  • Squash Commits Before they are Pushed with Interactive Rebase
  • Completely Remove a File from Pushed git History

Taught by

Chris Achard

Reviews

4.7 rating at egghead.io based on 221 ratings

Start your review of Fix Common Git Mistakes

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.