EzDevInfo.com

diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.

How can I compare files from two different branches?

I have a script that works fine in one branch and is broken in another. I want to look at the two versions side-by-side and see what's different. Are there any ways to do this?

To be clear I'm not looking for a compare tool (I use Beyond Compare). I'm looking for a git diff command that will allow me to compare the master version to my current branch version to see what has changed. I'm not in the middle of a merge or anything. I just want to say something like

git diff mybranch/myfile.cs master/myfile.cs

Source: (StackOverflow)

git diff for one commit

When I do git diff COMMIT I see the changes between that commit and HEAD (afaik) but I would like to see the changes that were made by that single commit.

I haven't found any obvious options on diff/log that will give me that output.


Source: (StackOverflow)

Advertisements

Graphical DIFF programs for linux [closed]

I really like Araxis Merge for a graphical DIFF program for the PC. I have no idea what's available for linux, though. We're running SUSE linix on our z800 mainframe. I'd be most grateful if I could get a few pointers to what programs everyone else likes.


Source: (StackOverflow)

What is the Windows equivalent of the diff command?

I know that there is a post similar to this : here.
I tried using the comp command like it mentioned, but if I have two files, one with data like "abcd" and the other with data "abcde", it just says the files are of different sizes. I wanted to know where exactly they differ. In Unix, the simple diff tells me which row and column, the comp command in windows works if I have something like "abd" and "abc". Not otherwise. Any ideas what I can use for this?


Source: (StackOverflow)

How to read the output from git diff`?

The man page for git-diff is rather long, and explains many cases which don't seem to be necessary for a beginner. For example:

git diff origin/master

Source: (StackOverflow)

git diff - handling long lines?

I'm running git-diff on a file, but the change is at the end of a long line.

If I use cursor keys to move right it loses colour coding and worse the lines don't line up, making it harder to track the change.

Is there a way to prevent that problem, or to simply make the lines wrap instead?

(running git 1.5.5 via mingw32)


Source: (StackOverflow)

Git diff -w ignore whitespace only at start & end of lines

I love to use git diff -w to ignore whitespace differences. But, I just noticed that it ignores even whitespace differences in the middle of lines. How could I only ignore whitespace differences that come at the start (^) or end ($) of lines?


Source: (StackOverflow)

Highlight the difference between two strings in PHP

What is the easiest way to highlight the difference between two strings in PHP?

I'm thinking along the lines of the Stack Overflow edit history page, where new text is in green and removed text is in red. If there are any pre-written functions or classes available, that would be ideal.


Source: (StackOverflow)

Diff two tabs in Vim

Scenario: I have opened Vim and pasted some text. I open a second tab with :tabe and paste some other text in there.

Goal: I would like a third tab with a output equivalent to writing both texts to files and opening them with vimdiff.

The closest I can find is "diff the current buffer against a file", but not diffing two open but unsaved buffers.


Source: (StackOverflow)

Why does git diff on Windows warn that the "terminal is not fully functional"?

I'm using msysgit 1.7.7.1 on Windows. I get an error when using git diff. What is causing this? Is there no diff tool included in msysgit? What should I do?

WARNING: terminal is not fully functional


Source: (StackOverflow)

How to grep (search) committed code in the git history?

I have deleted a file or some code in a file sometime in the past. Can I grep in the content (not in the commit messages)?

A very poor solution is to grep the log:

git log -p | grep <pattern>

However this doesn't return the commit hash straight away. I played around with git grep to no avail.


Source: (StackOverflow)

How do I view 'git diff' output with a visual diff program?

When I type 'git diff', I want to view the output with my visual diff tool of choice (SourceGear diffmerge on Windows). How do I configure git to do this?


Source: (StackOverflow)

How do I show the changes which have been staged?

I staged a few changes to be committed; how can I see the diff of all files which are staged for the next commit? I'm aware of git status, but I'd like to see the actual diffs - not just the names of files which are staged.

I saw that the git-diff(1) man page says

git diff [--options] [--] […]

This form is to view the changes you made relative to the index (staging area for the next commit). In other words, the differences are what you could tell git to further add to the index but you still haven't. You can stage these changes by using git-add(1).

Unfortunately, I can't quite make sense of this. There must be some handy one-liner which I could create an alias for, right?


Source: (StackOverflow)

How to apply `git diff` patch without Git installed?

How can my client apply patch created by git diff without git installed? I have tried to use patch command but it always asks file name to patch.


Source: (StackOverflow)

How do I exit the results of 'git diff' in git bash on windows?

I'm using git bash on Windows 7. When I run git diff, I see this:

enter image description here

However, I'm unable to get back to a regular prompt. Pressing Ctrl+C seems to work, but as soon as I start typing a command, it's covered up with (END) as in that image.


Source: (StackOverflow)