在Visual Studio 2013中禁用自动提交更改的文件以混用 [英] Disable automatic commit of changed files in Visual Studio 2013 to git

查看:184
本文介绍了在Visual Studio 2013中禁用自动提交更改的文件以混用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在VS 2013中将一个新文件添加到web项目中时,它立即签入git ;该文件立即保存,然后在文件左侧出现签入图标。如果我对现有文件进行更改,那么当我保存该文件时,它将检入。请注意,源git存储库未被修改,但我认为我的本地存储库正在签入。



预期行为:



添加新文件或更改现有文件,保存,文件保留已检出,必须在准备就绪后手动检入。这是期望的行为,并且是该项目的行为方式,直到它开始按照同事的系统描述行事,并随后出现在我的两个系统中。

背景:

我的同事设法通过尝试使用几十种不同的技术(删除,重置等),将源代码控制过程恢复到原来的状态。不知道她做了什么来专门解决它。我在一台计算机上做了同样的事情,但一直未能解决它,但在另一个系统上,我也在我的方法中疯狂地摇摆,并设法使其工作。



如果我从VS 2013转到git命令行并输入git status,我会看到已更改文件的列表,但没有添加任何文件。在文件列表的上方是文本:

 在分支大师
您的分支是最新的起源/主。
没有为commit提交更改:
(使用git add< file> ...更新将提交的内容)
(使用git checkout - < file> ;. ..放弃工作目录中的更改)

我对TFS和SourceSafe非常熟悉,但是是我第一次使用git。我知道他们在源代码控制方面与众不同,他们也意识到我的术语(即签入,退出)更多是面向TFS / SS的,所以请原谅措辞中的错误。



项目信息:

这是一个使用Angular和Breeze以及Bower管理包的VS Web项目。正确工作的项目不使用Angular,Breeze或Bower。



结论:

任何人都可以告诉我这里发生了什么,或者有什么方法让我的项目恢复到它展示的最初行为?

解决方案

我在项目中遇到的问题是我的.gitignore文件是空的。在正常工作的项目中拷贝.gitignore文件的内容时,Visual Studio会返回向我显示已更改的项目,解决方案资源管理器中文件旁边的图标表示文件的正确状态(即更改,添加,等等。)。我不明白git足以知道为什么这会解决这个问题,但我想在这里发布这个以防其他人碰到这个问题。


Problem:

When I add a new file into a web project in VS 2013, it is immediately "checked in" to git; the file is immediately saved and then the "check in" icon appears to the left of the file. If I make a change to an existing file, the moment I save the file it "checks in". Please note that the source git repository is not modified, but I think my local repository is being checked into.

Expected behavior:

Add a new file or change an existing one, save, file stays "checked out" and must be manually checked in when ready. This is the desired behavior and was how this project behaved until it started behaving as described on a coworker's system and subsequently appeared on two of my systems.

Background:

My coworker managed to return the source control process back to what it was originally by trying a couple dozen different techniques - deletes, resets, etc., but doesn't know what she did to specifically fix it. I did the same on one computer and haven't been able to resolve it, but on my other system I also swung wildly in my approaches and managed to get it working.

If I go to the git command line from VS 2013 and enter "git status", I see a list of changed files, but no files that were added. Just above this list of files is the text:

On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

I am very familiar with TFS and SourceSafe, but this is the first time I've worked with git. I know that they are very different beasts in their approach to source control and also realize that my terminology (i.e. check in, check out) is more TFS/SS-oriented, so please forgive the error in wording.

Project Info:

This is a VS web project using Angular and Breeze as well as Bower to manage packages. The projects that are working "correctly" do not use Angular, Breeze, or Bower.

Conclusion:

Can anyone either tell me what is going on here or if there is some way to get my project back to the initial behavior it exhibited? Thank you in advance.

解决方案

The problem I was having with my project was that my .gitignore file was empty. Upon copying in the contents of a .gitignore file from a project that was working properly, Visual Studio returned back to showing me my changed items, icons beside the files in the Solution Explorer represented the proper state of a file (i.e. changed, added, etc.). I don't understand git enough to know why this fixes the problem, but I wanted to post this out here in case anyone else ran across this.

这篇关于在Visual Studio 2013中禁用自动提交更改的文件以混用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆