Any tips on visual diff of files without resorting to VNC?

May 19, 2016 370 views
Git Linux Commands System Tools Getting Started Ubuntu 16.04

I use 'git diff' to examine changes before committing changes on the server. On my development Mac I have git diff routed through opendiff (FileMerge) which makes reviewing the diffs much faster, especially when looking at SQL dumps with small diffs within lines that can be pages long.

One solution might be setting up X11 & VNC and something like meld to get a visual diff right on the server. But I bet the better approach would be to shoot the files back to my development machine and perform the diff there: no need to set up VNC or burn up bandwidth using it, no latency in the visual diff GUI...

Anyone have scripts already set up to do such a thing, or maybe a better approach altogether? I'd rather not reinvent the wheel, as simple as it may be. Thanks!

2 Answers

Hi @YearOfBenj,

There're a few different options you have, the easiest, and probably safest, is to use something like either vimdiff, or cdiff, while not as easy as some of the pure graphical options, they would allow you to do this over an SSH session.

An alternative would be to use your SSH session to pipe an X11 session back to your Mac, and then use a remotely executed visual linux tool, but that would likely be a little slow, and probably not as seamless as you're hoping for.

Hope that helps, and let us know if you have any further questions!

Thanks for the response. The solution I've used with success for the last few months has been to run afpd on the server and mount its git sandbox onto my Mac as an AFP network volume. It's slow to search, but if I already know the file paths of interest, which I can easily copy-and-paste from a grep in my ssh terminal, then I can use my favorite Mac editor to work on them and use opendiff to get a visual diff. I can recommend this workflow: simple and effective!

Have another answer? Share your knowledge.