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.
git checkout ./dir/filename.ext
- this is a handy way to undo local changes on a specific file, provided the changes have not been committedgit reset --hard
- this undoes all local uncommitted changes, removing any extra filesgit bisect
- used when you need to find when a bug or change was introducedgit remote -v
- shows the remote repositoriesgit clone https://github.com/xxxx/yyyy.git 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 changegit shortlog -10
- see who did the last 10 commitsgit rev-parse HEAD
- show the latest commit id, useful for scripts etcgit rev-parse origin/main
- show the latest commit id on the server's main branchgit show <commit-id>
- show the commit details for the specified commit-id