Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set git diff parameter in Github desktop gui

Is there a way in the latest github git gui for mac (desktop.github.com) to set the git diff parameters? For example I would like the git-gui to ignore-whitespace-change in diff

git diff --ignore-space-change
like image 215
klode Avatar asked Nov 23 '15 16:11

klode


People also ask

How do I compare files in Git GUI?

Compare Files (1), with TFS and Git GUI in Visual StudioIn Source Control Explorer, right-click a file and select Compare. The Compare dialog box is opened, At this point, we can choose any different two files, two folders, two versions of branches into the Source Path and the Target Path for the comparison.

How do I use git commands on my desktop GitHub?

You can use GitHub Desktop to complete most Git commands from your desktop with visual confirmation of changes. You can push to, pull from, and clone remote repositories with GitHub Desktop, and use collaborative tools such as attributing commits and creating pull requests.

How do I compare two GitHub branches on desktop?

Comparing branches is as easy as selecting the “compare to branch” option while perusing the feature branch you'd like to compare to another. The compare to branch option in GitHub Desktop is located under the “Branch” in the main menu at the top of the interface.


2 Answers

git-gui is not the same as the GitHub Desktop. git-gui comes with the Git installation (you can download the latest for OSX from git-scm.com/download/mac; the current version is 2.9.2 as of this answer date). Once installed, you can run git-gui from the command line (it installs at /usr/local/opt/git/libexec/git-core/git-gui). You can then access Preferences in Git Gui menu, and put -w (or --ignore-all-space) in Additional Diff Parameters field to ignore whitespace change, or add any other git-diff parameter.

GitHub Desktop, on the other hand, does not have such option available.

like image 143
Ville Avatar answered Oct 04 '22 19:10

Ville


Update Apr. 2021, 5 years later, GitHub Desktop can actually hide whitespace (GitHub Desktop 2.8):

Hide whitespace in diffs

Similar to being able to see more context around your changes, sometimes there are a lot of whitespace changes in a file that don’t allow you to get a clear picture of the substantive changes that happened.

Now, in both changes and history, you can optionally hide whitespace changes to allow you to focus just on the more meaningful changes to your code.

This feature was built almost entirely by Steven Yeh (@say25), a fantastic and close community contributor to GitHub Desktop. Steven is a long-time open source contributor to GitHub Desktop, and we’re immensely grateful for him continuing to help improve the product.

https://github.blog/wp-content/uploads/2021/04/GitHub-Desktop-hiding-whitespace-changes.gif

like image 26
VonC Avatar answered Oct 04 '22 18:10

VonC