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 .。

2020-10-20 Git:git add -f . 添加所有文件,包括被.gitignore忽视的文件

 

相关文章:

  • 2021-07-29
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2021-05-27
  • 2022-03-02
  • 2022-12-23
  • 2022-01-28
  • 2022-12-23
相关资源
相似解决方案