git 版本管控中去掉bin 目录

如果不小心把bin /obj 或者.user 文件加入了源码管控,则可以这样取消git管控:

1:确保.gitignore中没有“[Bb]in/”项,没有.gitignore 可以使用

$ touch .gitignore 来创建;

2:将bin或obj目录移除版本控制:git rm -f -r bin 

git 版本管控中去掉bin 目录_第1张图片

3:提交步骤2的修改:

$ git commit -m 'commit for the second times'

$ git push origin master

4: 添加bin \obj 等到.gitignore中:

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2019 cache/options directory
.vs/
# Uncomment if you have tasks that create the

 

你可能感兴趣的:(Git)