All Questions

656
votes
25answers
348164 views

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?
122
votes
12answers
83684 views

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...
368
votes
21answers
256851 views

Compare two MySQL databases

I'm currently developing an application using a MySQL database. The database-structure is still in flux and changes while development progresses (I change my local copy, leaving the one on the test-s...
1023
votes
12answers
245537 views

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> ...
91
votes
7answers
46793 views

How to remove the lines which appear on file B from another file A?

I have a large file A (consisting of emails), one line for each mail. I also have another file B that contains another set of mails. Which command would I use to remove all the addresses that appear ...
118
votes
4answers
13992 views

What are the differences between double-dot ".." and triple-dot "..." in Git diff commit ranges?

What are the differences between the following commands?: git diff foo master # a git diff foo..master # b git diff foo...master # c The diff manual talks about it: Comparing branches $ gi...
95
votes
7answers
54971 views

Fast way of finding lines in one file that are not in another?

I have two large files (sets of filenames). Roughly 30.000 lines in each file. I am trying to find a fast way of finding lines in file1 that are not present in file2. For example, if this is file1: ...
112
votes
6answers
42310 views

Can I make git recognize a UTF-16 file as text?

I'm tracking a Virtual PC virtual machine file (*.vmc) in git, and after making a change git identified the file as binary and wouldn't diff it for me. I discovered that the file was encoded in UTF-1...
39
votes
7answers
56397 views

How to perform string Diffs in Java?

I would need to perform Diffs between Java strings. I would like to be able to rebuild a string from the original string and diff versions. Does anyone has done this in Java? What library do you use? ...
126
votes
5answers
54968 views

Diff Algorithm

I've been looking like crazy for an explanation of a diff algorithm that works and is efficient. The closest I got is this link to RFC 3284 (from several Eric Sink blog posts), which describes in per...

Previous Next