.gitignore失效的解决办法
2015-01-30 09:52
288 查看
How to make .gitignore works?
Just got the answer from the IRC channel.
Running command:
This removes everything from the index, then just run:
Commit it:
To untrack a file that has already been added/initialized to your repository, ie stop tracking the file but not delete it from your system use:
git rm --cached filename (delete single cached file)
Yes - .gitignore system only ignores files not currently under version control from git. I.e. if you've already added a file called test.txt using git-add, then adding test.txt to .gitignore will still cause changes to test.txt to be tracked. You would have
to git-rm test.txt first, commit that change. Only then will changes to test.txt be ignored.
another problem I had was I placed an inline comment.
this works
# ignore my tmp foldertmp/
Just got the answer from the IRC channel.
Running command:
git rm -r --cached .(delete all cached file)
This removes everything from the index, then just run:
git add .
Commit it:
git commit -m ".gitignore is now working"
To untrack a file that has already been added/initialized to your repository, ie stop tracking the file but not delete it from your system use:
git rm --cached filename (delete single cached file)
Yes - .gitignore system only ignores files not currently under version control from git. I.e. if you've already added a file called test.txt using git-add, then adding test.txt to .gitignore will still cause changes to test.txt to be tracked. You would have
to git-rm test.txt first, commit that change. Only then will changes to test.txt be ignored.
another problem I had was I placed an inline comment.
tmp/* # ignore my tmp folder (this doesn't work)
this works
# ignore my tmp foldertmp/
相关文章推荐
- git .gitignore失效的解决办法
- git .gitignore失效的解决办法
- .gitignore失效的解决办法
- Git .gitignore忽略策略失效的解决办法
- git .gitignore失效的解决办法
- 彻底解决git中.gitignore文件失效原因及解决办法
- 【转】.gitignore失效的解决办法
- git .gitignore失效的解决办法
- Git忽略.gitignore规则不生效的解决办法
- .gitignore规则不生效的解决办法
- Git忽略规则及.gitignore规则不生效的解决办法
- Git忽略规则及.gitignore规则不生效的解决办法
- Git忽略规则及.gitignore规则不生效的解决办法
- Git忽略规则及.gitignore规则不生效的解决办法
- gitignore不起作用解决办法
- Git忽略规则及.gitignore规则不生效的解决办法
- gitignore 不起作用的解决办法
- Git忽略规则及.gitignore规则不生效的解决办法
- .gitignore无法忽略所有文件解决办法。
- Git忽略规则及.gitignore规则不生效的解决办法