Git: a random collection of commands and methods

Cloning a repository $ git clone “http://example.com/repo.git” Storing username and password $ git config credential.helper store $ git push http://example.com/repo.git Username: Password: Undoing a git merge: $ git reset –hard commit_sha $ git reset –hard HEAD~x ;where x is the number of commits to back up to Pulling just one file: $ git fetch {remote} $ git checkout FETCH_HEAD — {file} file update exclusions: $ git update-index –assume-unchanged {file} scratch pad: $ git-stash – Stash the changes in a dirty working directory away Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory.