Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Tuesday, April 21, 2020

Setting Beyond Compare as the default diff tool in Sourcetree

When you right click on a file that has changed in the Unstaged file panel of Sourcetree, you have an "External Diff" option. This post indicates that Sourcetree uses "whatever you have configured in your .gitconfig already as your default diff tool"

You can set Beyond Compare as your default diff tool by following the instructions posted here.

Diff
At a Windows command prompt, enter the commands:
  git config --global diff.tool bc
  git config --global difftool.bc.path "c:/Program Files (x86)/Beyond Compare 4/bcomp.exe"

Note: For Git versions older than 2.2 (git --version) replace "bc" with "bc3" in the above instructions.

3-way Merge Pro only

At a Windows command prompt, enter the commands:
  git config --global merge.tool bc
  git config --global mergetool.bc.path "c:/Program Files (x86)/Beyond Compare 4/bcomp.exe"

Note: For Git versions older than 2.2.0 (git --version) replace "bc" with "bc3" in the above instructions.

Launching Diffs and Merges

File Diff:
  git difftool filename.ext
Folder Diff:
  git difftool --dir-diff
3-way Merge:
  git mergetool filename.txt

Advanced Settings

To disable the "Launch 'bc3' [Y/n]?" prompt, run the command:
  git config --global difftool.prompt false
Git's default settings retain merge files with *.orig extensions after a successful merge.  To disable this safety feature and automatically delete *.orig files after a merge, run the command:
  git config --global mergetool.keepBackup false

Running the following command will open your .gitconfig file in an editor.
git config --edit --global

You will be able to see what the command did to edit your .gitconfig file.


Friday, June 01, 2018

Git Visualizations


Here are some visualization tools for git repositories

For github, https://github.com/crc8/GitVersionTree/network for your project

Git GUI. It should already be installed on your machine with Git for Windows.
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Git
From Git GUI, go to the “Repository/Visualize All Branch History” menu item

GitVersionTree https://github.com/crc8/GitVersionTree/releases
uses https://graphviz.gitlab.io/download/

TortoiseGit does have a log functionality that is useful
https://tortoisegit.org/download/

Saturday, December 05, 2015

Setting up VS 2013 and GitHub Locally

Install VS 2013

Set up source control provider Tools\Extensions and Updates. Choose Online, Search for git.
  • Choose "Git Source Control Provider" and install.
  • Switch to this provider in Tools\Options\Source Control
Add Pending Changes to Standard toolbar.
  • Right-Click on white space in tool bar, choose customize at the bottom
  • Pick Commands tab, choose the tool bar radio button, select the standard toolbar Click Add Command button, Choose the View Category, scroll down to Pending Changes Click the move down button until it is at the end of the standard toolbar.
Set Keep tabs. Tools\Options\ Search for "tabs" Find in Text Editor\All languages Choose the Keep Tabs radio button.
Show Line Numbers, Search for Line number in Tools\Options. Check "Line Numbers" in Text Editor\All Languages\General\

Install Git For Windows "Full installer for official Git for Windows"

  • Use defaults except for the following
  • In Select Components, choose Windows Explorer integration "Simple context menu (Registry based)" Git Bash Here
    "Use Git from the Windows Command Prompt" For Configuring the line ending conversions, choose "Checkout as-is, commit as-is" ### Install TortoiseGit Set User Info in TortoiseGit Settings\Git. Enter a user name and email.
Sample GitHub workflow:
  • Click Pending Changes button in VS 2013 standard toolbar.
  • check the files you want to commit
  • Enter comments and click the Commit button.
When you are ready to push
  • From the VS 2013 Pending Changes page Choose synch from the TortoiseGit drop down menu. Click the Push button.

TortoiseGit settings

Updated 2020-10-22
To use BeyondCompare4 for your diff and merge tools in TortoiseGit make the following changes in your settings. To get to the TortoiseGit settings, right-click on any folder and go to TortoiseGit\Settings.
Under Diff Viewer put this in for the External path
  • "C:\Program Files (x86)\Beyond Compare 4\BCompare.exe"
The child node under Diff View is Merge Tool. Use this for the External path
  • "C:\Program Files (x86)\Beyond Compare 4\BCompare.exe"