Questions tagged [git-diff]

Shows changes between the working tree and the committed contents of a git repository, or between two commits or branches of the repository.

git-diff(1) shows changes between the working tree and the committed contents of a git repository, or between two commits or branches of the repository.

It has a number of options to control which versions to diff and also how the produced diff output is formatted, see the man-page for details.

1085 questions
0
votes
1 answer

Git diff without clone

We recently migrated from SVN to Git, and I'm trying to convert our deployment scripts to pull from the new repo. One script creates a "hotfix", which just includes files that have changed between two selected tags using SVN diff. However, git diff…
thelr
  • 1,134
  • 11
  • 30
0
votes
3 answers

What is Git actually doing when I run git diff

As a newcomer to Git, can somebody please explain in relatively simple terms what git diff actually does, without going into branching/merging etc? From my experience I know the outcome of running it: Any files in my working directory that are…
Lars
  • 7,908
  • 11
  • 52
  • 70
0
votes
1 answer

What goes into determining git diff status codes?

I have two separate clones of the same remote git repository. In one of them, I created a file testme that contains a single line of text "test1". I added, committed, and pushed the file to origin. In the other clone, I again created a file…
Some Guy
  • 1,481
  • 12
  • 26
0
votes
2 answers

error in git log

So I have been coming into this git log error several times now. I wrote this simple java code to illustrate it. I commit my progress (writing it gradually) and then run git log -p --decorate class Mega { private int alpha = 0; private int…
luisfer
  • 125
  • 2
  • 10
0
votes
1 answer

Git diff filenames breaking consistency

This line was taken from a raw diff consisting of 2852 file changes (switched multiple libraries). diff --git "a/system/cms/config/database.php\n" "b/system/cms/config/database.php\n" Out of all 2852 file changes, this is the only diff in which the…
Alex Naspo
  • 2,052
  • 1
  • 20
  • 37
0
votes
2 answers

Git - How can I reliably query if any files in master have been updated, via a merge or commit, since a period of time?

There are number of questions which try to map the CVS ability of cvs diff -D "1 days ago" to git: Git - How can I list all files changed on the master branch between two times? How can I get the diff between all the commits that occurred between…
EMiller
  • 2,792
  • 4
  • 34
  • 55
0
votes
1 answer

Understanding git diff on files

What does the folowing output of git diff mean? diff --git a/README.md b/README.md index 24aa464..49c20f4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ LINE1 -LINE2 LINE3 I think I understand that the "-" new LINE2 means that the version…
techsjs2013
  • 2,607
  • 5
  • 20
  • 25
0
votes
2 answers

Git: Skip over a commit

Given a scenario where commit 1 installs a whole new functionality therefore it adds, deletes and changes a few functions. Afterwards a few commits are performed that only fix minor problems found in the meantime. Is it possible to skip over commit…
utxeee
  • 953
  • 1
  • 12
  • 24
0
votes
1 answer

Can a git diff.*.textconv converter determine whether to output colors?

Is it possible to determine whether git would output colors in the current situation when running a git diff.*.textconv converter? Example: git diff with color.ui=auto will output colors iff the output is a terminal. I would like the…
Max Nanasy
  • 5,871
  • 7
  • 33
  • 38
0
votes
1 answer

Find suitable parent commit for unrevisioned code to be added to an exisiting git repository

I need to include some code previously not under version control into a git repository already containing some commits. What I want to automate is the finding of a suitable "parent" commit which the new code will be a child commit of. After some…
Onur
  • 5,017
  • 5
  • 38
  • 54
0
votes
2 answers

When does Git show a file as modified, when it actually isn't?

The output of git diff says that the complete contents of one my files has been removed, and then added back. Why is this? diff --git a/templates/appengine/go/app.yaml b/templates/appengine/go/app.yaml index 303af12..223b642 100644 ---…
Andres Riofrio
  • 9,851
  • 7
  • 40
  • 60
0
votes
1 answer

Equivalent in git for `darcs whatsnew --summarize`? it summarizes current changes per file

I tried git diff --summary as stated in git diff help, but changes are not being summarized, git diff does output changes in 5 different files. Is there another way? Example of darcs whatsnew --summarize output: M ./XMonad/Prompt.hs -1 +1 M…
Carlos López-Camey
  • 2,504
  • 1
  • 17
  • 20
-1
votes
2 answers

I keep getting weird Git diffs with summaries line in XML comment

Everytime I add a property to a class with XML comments git thinks I added space below and a summary opening tag below instead of the of the one I wrote. For example, I added the property FirstName (line 16 to 20), but the git diff is (18 to 22). At…
-1
votes
1 answer

How to extract (c)hunk headers only from diff?

The results of diff will give you : @@ -74,6 +73,7 @@ com.jolbox bonecp-test - commons + ${project.classifier} test I…
waled
  • 3
  • 2
-1
votes
1 answer

Files when modified appear as new files git

I have a problem with git when modifying some files from the same project Appear like new For example, I have an a.php file - -namespace Core; - -interface IKernel -{ - public static function Start(); -} When modifying it after adding it in…