.gitignore失效的解决方法
2014-04-15 21:35
429 查看
转载自http://foreverdo.diandian.com/post/2012-09-20/40038034798
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
How to make .gitignore works?
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/
相关文章推荐
- .gitignore中增加过滤规则不起作用的解决方法
- 关于使用Github,gitignore不起作用的解决方法
- IntelliJ IDEA 的 .idea 目录加入.gitignore无效的解决方法
- IntelliJ IDEA 的 .idea 目录加入.gitignore无效的解决方法
- phpstorm 的.idea 目录加入.gitignore无效的解决方法
- 彻底解决git中.gitignore文件失效原因及解决办法
- git .gitignore失效的解决办法
- .gitignore忽略了文件,每次提交还是会变更这个文件的解决方法
- .gitignore 无法忽略文件的解决方法
- .gitignore失效的解决办法
- .gitignore文件不起作用的解决方法
- git .gitignore失效的解决办法
- 解决git版本控制中.gitignore文件失效的问题
- 【转】.gitignore失效的解决办法
- phpstorm 的.idea 目录加入.gitignore无效的解决方法
- git .gitignore失效的解决办法
- .gitignore 无法忽略文件的解决方法
- 点gitignore不起作用的解决方法
- .gitignore 失效问题解决
- .gitignore文件不起作用的解决方法