Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Online Git - How to make sure /packages are ignored?

Is my .gitignore even working? I added packages folder to it and it still wants to commit all my packages on every commit.

What I'm doing at the moment is excluding package folder on every commit which is horrible. Am I missing something or it is bug within Visual Studio/Visual Studio Online Git System?

.gitignore

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
packages/

Image

enter image description here

like image 927
Stan Avatar asked Nov 15 '13 20:11

Stan


1 Answers

Your .gitignore should work, since "Included changes" in TFS 2013 doesn't mean staged changes, according to the FAQ:

If you are an experienced Git user, you might have noticed that Visual Studio handles changes differently than the command prompt.
You might have wondered if the Included Changes section contains your staged changes.
In fact, Visual Studio usually bypasses the Git stage for you. When you commit changes, Visual Studio simultaneously stages and commits them.
The one exception occurs when you add a file to your Git repository; Visual Studio does stage this kind of change.

So if you added a file, you might have to check git status in command line, and do a git rm --cached of that file.

But if not added any file, this is likely a current bug, as illustrated in "TFS/Git extensions seems to ignore .gitignore".

like image 106
VonC Avatar answered Nov 03 '22 00:11

VonC