Disable git in Visual Studio 2013

I have a repository that is managed by tfs. However locally I would like to manage it via git and the push changes to tfs. Once I'm creating git repo over there VS2013 in team explorer shows this solution managed by git only. If I try to edit any file it complains that file is read only only I cannot save it in a previous version. So my question is there any way for Visual Studio 2013 to forget about git at all and manage it as tfs repository. I can manage git from command line. Or is there a way to make it to checkout files from tfs repo when I'm doing a changes?


For your scenario Git-tf is probably a better solution, it will create a local git repo based on your TFVC source control folder. When you're done, you can push your changes from Git directly to TFVC from the commandline. Since you're already comfortable on the commandline, that might work out pretty well for you.

It's very hard to force Visual Studio to currently stay on Team Foundation Source Control when there is a git repo in the same folder.


As a horrible workaround, close your solution, rename the .git folder to _git and reload the solution. This should bring TFVC back, but if it doesn't, then rebind the solution to TFVC if using file->source control->advanced->Change Source Control. Then after checking in, close the solution again, rename _git back to .git and reload.


As Ed mentions in the comments, you can move your .git folder to another folder, like this:

 MyProjects
    GitRoot
     |  .git
     MySolution
      MyFirstProject
      MySecondProject

This allows Visual Studio to use the TFVC bindings and you can tell the git commandline that the .git directory is elsewhere using the git --git-dir=MyProjectsGitRoot.git command argument.

You can set an environment variable named GIT_DIR to fix that in one go, as @hlovdal mentions.


And there is another trick that @Eric mentions which creates a text file names .git that has the following in it:

gitdir: _git

Rename .git folder to _git, then make sure you add _git to .gitignore

Tip: to create a file that starts with a . from Windows Explorer you can use the New/Text Document option:

在这里输入图像描述

Then name the file .git. (make sure the Show file Extensions option is ticked):

在这里输入图像描述


The solution outlined here works well for me: How can you disable Git integration in Visual Studio 2013 permanently?

Essentially:

  • Rename .git folder to _git, as @jessehouwing says
  • Create a text file called .git containing just the line "gitdir: /Path/To/_git"
  • Add _git to .gitignore
  • Visual Studio will now only use TFS and git works properly as well.


    I suggest theses steps :

  • Go to TOOLS Tab in Visual Studio
  • Select Options items
  • On the left, select Source Control
  • In the Plugin Selection Item, Enter None in the dropdownlist associated 在这里输入图像描述
  • 链接地址: http://www.djcxy.com/p/27086.html

    上一篇: Visual Studio 2013团队资源管理器/ Git集成缺少的文件

    下一篇: 在Visual Studio 2013中禁用git