为什么Visual Studio 2017允许GIT拉取未提交的更改? [英] Why is Visual Studio 2017 allowing GIT pull with uncommitted changes?

查看:114
本文介绍了为什么Visual Studio 2017允许GIT拉取未提交的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能记错了这一点,但是在我看来,Visual Studio从未允许我在进行任何未提交的更改时退出.

I could be remembering this incorrectly, but it seems to me like Visual Studio never allowed me to pull while I had any uncommitted changes.

但是,突然之间,我们能够做到这一点. 这是有问题的,因为它为这么多错误提供了空间.

However, suddenly, we're able to do just that. This is problematic because it makes room for so many mistakes.

我是否在某个地方不小心修改了设置?

Did I accidentally modify a setting somewhere?

使用TFS,GIT和VS 2017

Using TFS, GIT, VS 2017

推荐答案

来自 git pull文档:

在Git 1.7.0或更高版本中,要取消有冲突的合并,请使用git reset - 合并.警告:在较旧版本的Git中,不建议运行git pull并进行未提交的更改:可能的话,它会使您陷入 指出在发生冲突的情况下可能很难撤消.

In Git 1.7.0 or later, to cancel a conflicting merge, use git reset --merge. Warning: In older versions of Git, running git pull with uncommitted changes is discouraged: while possible, it leaves you in a state that may be hard to back out of in the case of a conflict.

如果任何远程更改与本地未提交的更改重叠, 合并将自动取消,并且工作树保持不变. 通常最好在工作之前先进行任何本地更改 使用 git-stash 将其拉出或藏起来.

If any of the remote changes overlap with local uncommitted changes, the merge will be automatically canceled and the work tree untouched. It is generally best to get any local changes in working order before pulling or stash them away with git-stash.

第二段描述了您正在观察的行为.

The second paragraph describes the behavior you're observing.

这篇关于为什么Visual Studio 2017允许GIT拉取未提交的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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