Git:git add -f . 添加所有文件,包括被.gitignore忽视的文件
一、git add -help
usage: git add [<options>] [--] <pathspec>...
-n, --dry-run dry run
-v, --verbose be verbose
-i, --interactive interactive picking
-p, --patch select hunks interactively
-e, --edit edit current diff and apply
-f, --force allow adding otherwise ignored files
-u, --update update tracked files
-N, --intent-to-add record only the fact that the path will be added later
-A, --all add changes from all tracked and untracked files
--ignore-removal ignore paths removed in the working tree (same as --no-all)
--refresh don't add, only refresh the index
--ignore-errors just skip files which cannot be added because of errors
--ignore-missing check if - even missing - files are ignored in dry run
二、git add .不会添加被.gitignore忽视的文件,而git add -f . 强制添加所有文件,即使是.gitignore忽视的文件也添加。
三、下图kati文件夹已经被.gitignore忽视掉,用git add .是不会包括该文件夹的,用git add -f .。