Skip to content

Instantly share code, notes, and snippets.

@philcruz
Last active October 3, 2016 15:21
Show Gist options
  • Save philcruz/23ed2d9574a92f80c225721e7afd44cb to your computer and use it in GitHub Desktop.
Save philcruz/23ed2d9574a92f80c225721e7afd44cb to your computer and use it in GitHub Desktop.
Git Cheat Sheet

Create

Convert existing non-empty directory into a Git working directory and push files to a remote repository

cd <localdir>
git init
git add .
git commit -m 'message'
git remote add origin <url>
git push -u origin master

Compare

Compare branches: git difftool --dir-diff some-branch another-branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment