Tag: diff

Difference between a directory on two remote branches on git

I’d like to find the difference between a given directory on two remote branches. Currently I can compare the two branches like so gitk –left-right remote/branch1 remote/branch2 But that’s giving me way too much information. I’d like to limit the diff to one directory, foobar. Is this possible?

Equivalent of git add –patch with two local files

I have two versions of a long configuration file that have diverged (edited by different users). I want to reconcile them into one file that includes the best of both existing versions. I know there are dedicated tools for tasks like these (e.g., vimdiff), but I’m used to the workflow of git add –patch for […]

How to configure git-diff so that long line not wrap around?

I sometimes have long line of code in git repo (e.g. a json config file), and git diff will generate output like below. On an EC2 instance, I git diff doesn’t wrap the content to the next line, generating following output (I can use left/right keys to navigate), which I personally prefer. Does any one […]

Extract meaningful changes with git diff

I’m trying to obtain changes between commits for a large number of HTML documents, but I quickly noticed that most changes are not important and are usually the result of logging, changes in versions to prevent caching or external scripts. For example: <a class=”support-ga” target=”_blank” href=”#”>0fb63cacd50e / 0fb63cacd50e @ -app-151</a> +app-107</a> <input type=’hidden’ name=’csrfmiddlewaretoken’ -value=’82NB5DdySoICu1mqcl0RZVk5dMCOVEQd’ […]

How to tell `git log –stat` to count empty lines

General question How can I tell git, that it should also count empty lines in a diff, when using git log –stat? Code example git clone https://github.com/voldemort/voldemort.git cd voldemort git log –numstat -n 1 c21ad76 contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderReducer.java git show c21ad76 — contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderReducer.java More details In the given example git log –numstat claims for commit c21ad76, that […]

What do ++ and +- mean in a Debian diff file?

I’m currently viewing the Ubuntu Rhythmbox source diff, (you can view this via gzip -d < rhythmbox_0.12.8-0ubuntu6.diff.gz | less on the command line). Here’s an excerpt: +diff –git a/plugins/status-icon/status-icon-ui.xml b/plugins/status-icon/statu s-icon-ui.xml +index a5cb6e1..a4eee9d 100644 +— a/plugins/status-icon/status-icon-ui.xml ++++ b/plugins/status-icon/status-icon-ui.xml +@@ -15,12 +15,26 @@ + <menuitem name=”PreviousTray” action=”ControlPrevious”/> + <menuitem name=”NextTray” action=”ControlNext”/> + <separator/> +- <menuitem name=”ShowWindowTray” […]

diff and new empty files

I’m using diff -Naur to send a single patch to a customer, in order to update their snapshot of our repository. I tried using git diff -p to get a single file patch, but apparently it doesn’t include new binary files in the patch I know I should have used git-format-patch, but it creates patches […]

Can I generate a “merge tool viewable” diff output with git?

For small chunks of code, I can manage writing: git diff SOURCE_FILE but when it gets past a number of lines, it gets difficult to watch. Is there someway of generating two files, one being the staged one, the other containing the modifications, and compare them using a tool like WinMerge?

Resolving conflicts in git version control

I’ve got a big problem but I bet it’s easy to solve. I’m developing a website together with a friend using GiT for versioning control. We’ve just modified different parts of the same CSS file and then commited, then he pushed his commit. We’re both using master branches in local and remote repository for we […]

What are the arguments that git diff uses for diff command?

When you invoke git diff, it’s using the diff utility to compare files, however, not in the default way. It’s using a number of extra options, some I can name are: Different markers before lines: +/- instead of >/<. A few lines of context before and after the actually different lines. But I’m not sure […]

Git Baby is a git and github fan, let's start git clone.