如果不小心把bin /obj 或者.user 文件加入了源碼管控,則可以這樣取消git管控:
1:確保.gitignore中沒有“[Bb]in/”項,沒有.gitignore 可以使用
$ touch .gitignore 來創建;
2:將bin或obj目錄移除版本控制:git rm -f -r bin
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