Git ‘Er Done

The branches of Yggdrasil, the World Tree, hold all of existence.
  • ls // list
  • git — help
  • git pull origin [branch]
  • git add . // add all changes
  • git commit -m “commit notes”
  • git push origin [branch]
  • git branch [branch] // create a new branch
  • git switch [branch] // switch the current branch
  • git merge [branch] // merge [branch] into the current branch
  • git log // list of commits (press “q” to get back to the command line)
  • git checkout [hashcode] // make a previous commit the current “pseudo branch”
  • git checkout -b [new-branch-name] [hashcode] // create a new branch from the old commit
  • git reset — hard [hashcode] // reset to an older commit
  • git push — force origin [branch] // Revert back to the older commit. WARNING: Destroys all commits afterwards! Better to make a new branch form the old commit.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store