RecursiveCall
RecursiveCall

Reputation: 492

Using a Git Repo in a TFS Team Project

I have my own TFS server where I have a Team Project that contains a Visual Studio solution that relies on another project that I get from GitHub (with TortoiseGit). The solution references the project from Git. Every time I open the solution, TFS nags me to add the Git repo to TFS control. There is no option to ignore.

I placed a .tfignore file (ignoring the directory created by Git) in the root of the solution (Team Project level) and then tried moving it down to the solution folder. TFS just seems to ignore the .tfignore file (no pun intended).

Upvotes: 2

Views: 270

Answers (1)

VonC
VonC

Reputation: 1328322

TFS just seems to ignore the .tfignore file (no pun intended).

This maybe related on how TFS ignores files. See this workaround

when adding a file from Solution explorer this is considered an Explicit add of the item, the tfignore rules are not applies on Explicit adds by design. Also tfignore rules are not enforced during checkin time, the are enforced during pend add time.

The workaround for this issue is to basically UNDO the add on the .generated.cs files once added to the solution (or to TFS) in doing so the explicit add will be undone, and the files will be automatically ignored.

So if the directory created by git is an explicit add, you would need to undo that add first, before hoping to see your tfignore works.

Upvotes: 1

Related Questions