git add . 会把本地所有untrack的文件都加入暂存区,并且会根据.​​gitignore​​做过滤;

git add * 会忽略.gitignore把任何文件都加入.

一个 .gitignore 文件例子:

*.o
*.a
*.so
_obj
_test
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.exe~
*.test
*.prof
*.rar
*.zip
*.gz
*.psd
*.bmd
*.cfg
*.pptx
*.log
*.xlsx
*nohup.out
*settings.pyc
*.sublime-project
*.sublime-workspace
!.gitkeep
.DS_Store
/.idea
/.vscode
/output
*.local.yml
kx.yml
/log
/_rpc_idl
/_idl_gen