Skip to content

Instantly share code, notes, and snippets.

@mickelsonm
Created June 4, 2014 15:37
Show Gist options
  • Save mickelsonm/3b3b4362fcd5e36f8d64 to your computer and use it in GitHub Desktop.
Save mickelsonm/3b3b4362fcd5e36f8d64 to your computer and use it in GitHub Desktop.
basic help for git
//get a codebase to start with
'git clone http://github.com/repository' : Clone whatever the default repository is.
'git clone http://github.com/repository -b <specific branch name>': Clones a specific branch of a repository.
//get updates, get informed about conflicts, etc.
'git pull'
//get status of what changed within your checked out code
'git status'
//add all the changes to the pending changelist
'git add .' or 'git add --all'
//undo changes to a file, restore files, etc.
'git checkout file' or 'git checkout /path/to/file.ext' or 'git checkout /path/to/where/file/was.ext'
//compare/visually see what files were changed or added, etc.
'git diff'
//if everything looks good with the code, go ahead and commit the changes to the changelist
'git commit -m "I am changing the world by submitting these epic code changes."'
//submit all changes/adds/deletes back to the checked out repository
'git push'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment