简体   繁体   中英

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.

In Subversion when two team members change the same source file and there's no unsolved conflict the logic on commit is:

  1. First team member update the local (no changes here) copy and then commit change with tag "Changes in Method A".
  2. Second team member update the local copy (changes automatic merged) and then commit change with tag "Changes in Method B".

In Git I have other behavior:

  1. First team member sync and commits and push changes with tag "Changes in Method 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).
  3. The VS creates a 3rd commit with automatic text "Merge branch 'master' of http://..." where contains the final version with the two commits.
  4. Then the second member can push this two commits and the history of the file gets 3 commits.

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?

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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