Tag: diff

how is a diff pathspec defined

In gitdiffcore(7) it simply states: The pathspecs are used to limit the world diff operates in. They remove the filepairs outside the specified sets of pathnames. E.g. If the input set of filepairs included: :100644 100644 bcd1234… 0123456… M junkfile My question is how to read this, i.e. which fields are which, and what should […]

Git > diffs filtered, show only certain changed classes/files

I have 2 versions of a software (i.e. tag 4.1 and tag 4.2). Now I want to filter out in which java classes of version 4.1 there were fixed bugs. If I enter git diff r4.1 r4.2 –name-only > patch.csv I get a list of all changed classes from version 4.1 to 4.2. But this […]

How do I copy part of a commit diff in GitHub without the pluses and the minuses?

It’s very often that I need to copy-and-paste part of a GitHub commit. Whenever I do this, however, I find myself manually going down each line and hitting Delete to strip all of the +/- signs. Is there a more convenient way to copy part of a GitHub commit to the clipboard? Suggestions involving Chrome […]

Git diff for copied files

Say I have a file, myfile.txt. It has a paragraph of text in it, and I copy it to a new file, myfile2.txt. If I git diff, it will show myfile2.txt as a new file. Okay. Now I replace every occurrence of “the” with “hello” and commit. The problem I’m having is that after the […]

Why does git difftool use git diff instead?

I want git diff to be a quick command line solution to see the difference between two files, and then I want git difftool to launch meld for a more graphical view of the file differences. Currently, git diff does exactly what I want it to, however when I run git difftool script.js, git tries […]

Diff Word docx files in Sourcetree on Windows 7

I have been trying to get a text diff of Word .docx files working in Sourcetree on Windows 7. I have followed the instructions here Using Microsoft Word with git to use Pandoc and can get it working from the command line. Unfortunately I can’t get that diff to appear in Sourcetree. Is there something […]

Git get changes between hash A and B to working directory

Some changes were made in git between hash A and hash B (the branch latest is in Z – thousands of commits later). I’d like to have the HEAD (my local one) point to hash A and have in my working directory all changes that were made between A and B. Why? Because git diff […]

GitHub – why two lines are marked as different without any visible differences?

Here’s the commit cba438 on Github. As you can see line #1 in index.html is marked as changed: But as I can see there’s no single changed character. Is it up to GitHub or Git? Is it a bug or some hidden character was changed?

Does increasing the number of unified diff context lines have any downsides?

By default, diff -u and git diff produce unified diffs with context lines. Apart from the size of the diff file itself, is there any disadvantage to increasing the number of context lines? I assume that it may help in cases where the file(s) to be patched have been modified since the patch was made. […]

How to make git diff treat a file as binary _only sometimes_

I work with .xib files which are XML. Most often, I want to treat them as a binary file, because changes tend to be non-human-readable and spread over many parts of the file. Thus, I’ve set up my .git/info/attributes file like so: *.xib -diff So far so good, but sometimes I do want to see […]

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