Git Commands

This section focuses on different git commands and their most common or useful options, as child pages. However there are some extra notes here as well.

Useful Commands

git checkout ./dir/filename.ext - this is a handy way to undo local changes on a specific file, provided the changes have not been committed
git reset --hard - this undoes all local uncommitted changes, removing any extra files
git bisect - used when you need to find when a bug or change was introduced
git remote -v - shows the remote repositories
git clone newdir - clone code to "newdir" instead of "yyyy"
git pull --rebase origin master - you need all changes in commits, but this will revert your commits, apply all the missing commits from the remote master and then re-apply your commits, very useful for bringing a branch up to do ready to merge it, but note, your commit ids will change