1

I'm using Git-TF (bridge between Git and Team Foundation Version Control (tfvc))

git tf pull downloads .vssscc, .vspscc files into the repository and commits. So if I use git push next, it uploads those files into remote repository which is not desired behavior for me.

I was trying to make git tf pull aware of .gitignore file. Based on this post I added following lines into the .gitconfig

[alias]
   apply-gitignore = !git ls-files -ci --exclude-standard -z | xargs -0r git rm --cached

and called git apply-gitignore. As far as my understanding, it removes files from repository (not physically, just awareness). Next I had to ran git commit -a -m "TFS2Git" and finally git push -u origin master --force which worked fine and pushed the source into remote repository (GitHub) without unwanted files.

Next, I did some fake updates and pulled remote source into local repository and checked-in to TFS via git tf checkin. Unfortunately it actually deleted unwanted files from the solution.

Is there a workaround to fix this issue?

Community
  • 1
  • 1
cilerler
  • 9,010
  • 10
  • 56
  • 91

1 Answers1

0

If you add a .gitignore file using the Visual Studio IDE (Team Explorer | Settings | Source | Add .gitignore) it will automatically have the exclude patterns that you are looking for.

  • Thank you for the response. I believe you are missing something here. I'm not talking about IDE or VS git features. **.gitignore** is already in there. [Git-TF](https://gittf.codeplex.com/) is a tool that creates a bridge between Team Foundation Version Control (tfvc) and Git repository. It works outside of the IDE and it is the one which ignores **.gitignore** – cilerler Feb 06 '15 at 20:07
  • You should not have those files checked into TFS. So this should not even be a problem. Go delete the files from TFVC and the problem will go away. You can use .tfignore to prevent TFVC users checking in those sort of files... – MrHinsh - Martin Hinshelwood Feb 07 '15 at 08:53
  • I just removed the *.suo etc part from the title since those are not goes into the TFS (and thank you for reminding me that) But .vssscc, .vspscc I didn't know that, we can eliminate those files to be checked-in. I mean those files always gets check-in by visual studio. Let me research it little bit and I will get back to you. Thank you for the lead! – cilerler Feb 07 '15 at 10:39