Show local and remote branches
See branches sorted by the last commit
git branch --sort=-committerdate
Note: some git commands require installing globally NPM module diff-so-fancy.
npm i -g diff-so-fancy
See the diffs with the log
git log -p
Get the file from another branch
git checkout <branch name> <filename>
Checkout previous branch
cd - goes to the previous working directory,
git checkout - goes to the previously checkout branch.
Git CLI commands
I use git-extras to perform all my Git commands from the terminal.
Remove untracked files
Sometimes you get a bunch of generated files in the repo, and would like to remove them.
first, see which files will be removed