2

I have set my .gitignore to ignore both .sdf files and .vcxproj but they still keep appearing at Git Extensions for me to commit them.

Specifically the *.sdf are causing tons of conflicts as it keeps being updated by vs10, and it prevents me from pulling to my other workstation. Uploading 32mb each time is just not possible.

Here is my .gitignore file:

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
*.sdf
*.sln
*.suo
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Roslyn cache directories
*.ide/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.ipch
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
*.ipch
ipch/atr tp-e6975b4b/atr tp-ffcb10b7.ipch
ATR TP.sdf
ATR TP/ATR TP.vcxproj

I am sorry if this question was already posted elsewhere, but I searched for a while and couldn't find a suitable answer.

GChamon
  • 456
  • 5
  • 12
  • Once they've been manually added (or pre ignore file?) I think you have to remove them before the ignore will work on them. – John Nov 04 '14 at 21:02
  • Nice! I had to close visual studio, go to bash, go to my directory and type then and then push it and now sdf is now showing anymore. Still gonna keep my vcxproj included though. Whenever I have to use precompiled headers i'm gonna need that in my repo. Thanks @John. sorry for the extremely n00b question, i'm still getting the hang of this SVC – GChamon Nov 05 '14 at 03:37
  • Glad to hear that worked :), I added it as an answer if you want to accept it – John Nov 05 '14 at 06:09
  • Sure thing! I am still struggling to set git up in my notebook. I have constant conflicts and most of the times I have to delete my local repo and redownload. I don't have this issue in my desktop, strangest thing. – GChamon Nov 07 '14 at 02:04

1 Answers1

11

Git Ignore only works on files that haven't already been added to source control already. You'll need to remove them manually and then they will be properly ignored.

How to stop tracking and ignore changes to a file in Git?

Community
  • 1
  • 1
John
  • 6,503
  • 3
  • 37
  • 58