我想配置Visual Studio默認狀況下打開Beyond Compare做爲diff工具。 我怎樣才能作到這一點? php
若是您使用的是TFS,則能夠在Team Foundation中的diff / merge配置中找到更多信息- 常見的Command和Argument值 git
它顯示瞭如何配置如下工具: 緩存
在Visual Studio 2008 +中,轉到 app
Tools menu --> select Options
在選項窗口 - >展開源代碼管理 - >選擇Subversion用戶工具 - >選擇超越比較 ide
而後單擊肯定按鈕.. 工具
當一個新版本的Visual Studio出現,或者我移動PC,或者一個新成員加入團隊時,我每6個月就會厭倦這樣作。 那麼,PowerShell: ui
# .Synopsys # Sets up Beyond Compare professional as Diff tool for all instances of Visual Studio on this PC # If you don't use TFS, change the sccProvider as appropriate [CmdLetBinding()] param( $bcPath = 'C:\Program Files (x86)\Beyond Compare 3\BComp.exe', $sccProvider = 'TeamFoundation' ) $ErrorActionPreference = 'stop'; $baseKey = 'REGISTRY::\HKCU\Software\Microsoft\VisualStudio\*' function SetRegKeyProperties($keyPath, [hashtable]$keyProps){ if(!(Test-Path $keyPath)){ Write-Verbose "Creating $keyPath" # Force required here to recursively create registry path [void] (new-item $keyPath -Type:Directory -Force); } foreach($prop in $keyProps.GetEnumerator()){ Set-ItemProperty -Path:$keyPath -Name:$prop.Key -Value:$prop.Value; } } $configBases = dir $baseKey | ? { $_.PSChildName -match '^\d+\.\d$' } foreach($item in $configBases){ Write-Host "Configuring $item" $diffToolsKey = Join-Path $item.PSPath "$sccProvider\SourceControl\DiffTools" SetRegKeyProperties (Join-path $diffToolsKey '.*\Compare') @{Command=$bcPath;Arguments='%1 %2 /title1=%6 /title2=%7'} SetRegKeyProperties (Join-path $diffToolsKey '.*\Merge') @{Command=$bcPath;Arguments='%1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9'} }
適用於個人機器。 因人而異。 沒有保證,也沒有退款。 VS彷佛沒有緩存密鑰,所以當即生效。 this
64位Windows 7上的VS2013須要如下設置:工具| 選項| 源控制| 爵士源控制 spa
檢查複選框使用外部比較工具......(很容易錯過) 操作系統
雙向比較可執行文件的位置:C:\\ Program Files(x86)\\ Beyond Compare 3 \\ BCompare.exe
3路衝突比較可執行文件的位置:C:\\ Program Files(x86)\\ Beyond Compare 3 \\ BCompare.exe
若是你使用GIT做爲你的源代碼管理系統而不是(至關過期的) TFVC,那麼Visual Studio沒有選項來配置這樣的東西。
相反,它(在我看來正確)使用GIT配置文件的設置 。 所以,若是您已經使用GIT設置來使用Beyond Compare或任何其餘第三方比較軟件,它就會選擇它並開始使用它。
若是沒有,那麼只需將其設置(請參閱此處以獲取更多信息以及更新的幫助)。 使用Beyond Compare 4設置Visual Studio的相關信息是:
%HOMEDRIVE%%HOMEPATH%/.gitconfig
。請參閱此處獲取信息)或者若是您但願它是repo specifict,那麼在Git存儲庫中啓動項目後,編輯配置文件在項目文件夾中的.git文件夾中。 更改配置文件以反映如下更改:
[diff] tool = bc4 [difftool "bc4"] cmd = \\"C:\\\\Program Files (x86)\\\\Beyond Compare 4\\\\BComp.exe\\" \\"$LOCAL\\" \\"$REMOTE\\" [merge] tool = bc4 [mergetool "bc4"] cmd = \\"C:\\\\Program Files (x86)\\\\Beyond Compare 4\\\\BComp.exe\\" \\"$REMOTE\\" \\"$LOCAL\\" \\"$BASE\\" \\"$MERGED\\"
若是使用64位安裝程序,請驗證可執行文件的名稱。 我是BCompare.exe
[diff] tool = bc4 [difftool "bc4"] cmd = \"C:\\Program Files\\Beyond Compare 4\\BCompare.exe\" \"$LOCAL\" \"$REMOTE\" [merge] tool = bc4 [mergetool "bc4"] cmd = \"C:\\Program Files\\Beyond Compare 4\\BCompare.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"
問題:若是您建立一個新的項目,並獲得VS建立混賬回購協議的同時, 將覆蓋的負載添加到.git/config
文件,強制其使用Visual Studio再次(感謝您的MS!)。 在項目設置完成後經過其餘方式建立git repo(如經過SourceTree或命令行等...)或編輯.git/config
文件(在解決方案文件夾中)並刪除上述設置的任何覆蓋。
感謝minnow在評論中再次引發個人注意。
注意:我一直遇到這個,但我使用VS和GIT而且答案不正確,雖然有些評論提到了一個帶正確答案的網址但不清楚,若是我一直不知道,我相信其餘人會如此但願這能解決這個問題。