How could I ignore bin and obj folders from git re

2019-01-31 05:36发布

I want to ignore bin and obj folders from my git repository. As I've found out, there is no easy way to do this in .gitignore. So, are there any other way? Using clean solution in Visual Studio?

4条回答
Bombasti
2楼-- · 2019-01-31 05:40

simply making entry in gitignore may not ingore files, you may need to commit it. I used the following method and worked for me

git rm -r --cached .

git add .

then

git commit -am "Remove ignored files"

However this ignore my scripts folder which I included later into repository.

查看更多
Ridiculous、
3楼-- · 2019-01-31 05:49
  • Locate the bin and obj folders in Windows Explorer
  • Right click TortoiseGit > Delete and add to ignore list > bin
  • Right click TortoiseGit > Delete and add to ignore list > obj
查看更多
趁早两清
4楼-- · 2019-01-31 05:55

I'm not sure why this doesn't work for you. In case it helps, here's a typical .gitignore file from one of my Visual Studio/git projects:

*.suo
*.user
_ReSharper.*
bin
obj
packages
查看更多
The star\"
5楼-- · 2019-01-31 06:01

If you want to ignore bin and obj in ALL your projects then you can use (from gitignore man page)

Patterns read from the file specified by the configuration variable core.excludesfile.

core.excludesfile can be set in a config file which is ~/.gitconfig in Unix - I don't know where it is under Windows

查看更多
登录 后发表回答