Skip to content

Instantly share code, notes, and snippets.

@AndyA
Created August 7, 2014 11:40
Show Gist options
  • Select an option

  • Save AndyA/edb97991e25828e714fb to your computer and use it in GitHub Desktop.

Select an option

Save AndyA/edb97991e25828e714fb to your computer and use it in GitHub Desktop.

Hello Git!

initialise Git:

  • git config --global user.name "smoo"

  • git config -- global user.email me@mydomain.com

  • pwd (print working directory)

  • git add . (adds file)

  • git commit -m "describe this version"

  • git status

  • git log (shows all commits so far)

  • git (shows all available commands)

  • git branch (shows current branches)

  • git branch branchname

  • git branch (will now show new branch)

  • git checkout branchname (changes focus to branchname)

  • git branch (will now show branchname as current file)

  • git branch master (changes back to master file)

  • git merge branchname (merges branchname with whichever path you're on when you use it

  • create a file to ignore, call it .gitignore

  • add any files to this list, one line each - that you don't want to be committed

  • touch README.md (make a readme markdown file)

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