git notes - simeonlam/knowledge GitHub Wiki

reset/clean local workspace

git clean -d -x -f

# will remove untracked files, including directories (-d) and files ignored by git (-x). 
# Replace the -f argument with -n to perform a dry-run or -i for interactive mode, and it will tell you what will be removed.

remove large file in git history ref

  • take long time
  • rewrite history start from remove large file
git filter-branch --tree-filter 'rm -f ${large file path}' HEAD

[fix] git branch -a don't print in console

https://stackoverflow.com/a/48370253

git config --global pager.branch false
git config --global pager.tag false