简体   繁体   English

用于Git提交系统的Visual Studio工具

[英]Visual Studio Tools for Git commit system

I'm moving from Subversion to Git under Visual Studio 2012. In a small team we work with master branch shared across team members. 我在Visual Studio 2012下从Subversion迁移到Git。在一个小团队中,我们与master分支机构成员共享。

In Subversion when two team members change the same source file and there's no unsolved conflict the logic on commit is: 在Subversion中,当两个团队成员更改相同的源文件并且没有未解决的冲突时,提交的逻辑是:

  1. First team member update the local (no changes here) copy and then commit change with tag "Changes in Method A". 第一个团队成员更新本地(此处没有更改)副本,然后使用标记“方法A中的更改”提交更改。
  2. Second team member update the local copy (changes automatic merged) and then commit change with tag "Changes in Method B". 第二个团队成员更新本地副本(更改自动合并),然后使用标记“方法B中的更改”提交更改。

In Git I have other behavior: 在Git我有其他行为:

  1. First team member sync and commits and push changes with tag "Changes in Method A". 第一个团队成员使用“方法A中的更改”标记同步并提交和推送更改。
  2. Second team member can't sync as there's conflict so he commits changes with tag "Changes in Method B" and then pull changes (changes automatic merged). 第二个团队成员因为存在冲突而无法同步,因此他使用“方法B中的更改”标记进行更改,然后拉出更改(更改自动合并)。
  3. The VS creates a 3rd commit with automatic text "Merge branch 'master' of http://..." where contains the final version with the two commits. VS创建第3个提交,其中包含自动文本“http:// ...”的“合并分支'主数据”,其中包含具有两个提交的最终版本。
  4. Then the second member can push this two commits and the history of the file gets 3 commits. 然后第二个成员可以推送这两个提交,文件的历史记录获得3次提交。

This automatic commit don't allow change text (only when I get conflict to solve by hand). 此自动提交不允许更改文本(仅当我手动解决冲突时)。 Is that the correct way to work with Visual Studio Tools for Git? 这是使用Visual Studio Tools for Git的正确方法吗?

As long as a Commit has not been pushed to the remote and hasn't been shared with other team members you can change it using the Commandline. 只要未将提交推送到远程并且未与其他团队成员共享,您可以使用命令行进行更改。 Using Git commit --amend you can update the commit message locally before pushing it back to your Git repository . 使用Git commit --amend您可以在将提交消息推送回Git存储库之前在本地更新提交消息

This command hasn't been exposed using the Visual Studio UI in the current version of the Visual Studio Tools for Git, so for now the commandline is your only option. 在当前版本的Visual Studio Tools for Git中,尚未使用Visual Studio UI公开此命令,因此现在命令行是您唯一的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM