Skip to content

Instantly share code, notes, and snippets.

@zhenyi2697
Created August 13, 2015 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhenyi2697/82ffc3d155ba28fa30b4 to your computer and use it in GitHub Desktop.
Save zhenyi2697/82ffc3d155ba28fa30b4 to your computer and use it in GitHub Desktop.

git里ignore文件有四种方式

  1. 最基本的,放在.gitignore里
  2. 还未track的文件,但是不想放到.gitignore里,可以放到 .git/info/exclude里

vim .git/info/exclude

  1. 已经track的文件,而且被本地修改了,想要ignore本地的修改

find ./ -name "*.launch" -exec git update-index --[no-]skip-worktree '{}' ;

  1. 已经track的文件,之前没有被.gitignore,后来加入到.gitignore里了

git rm --cached [-r] files_pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment