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: how to see only staged/cached/indexed differences?

I want to see a context diff for only my indexed changes with git diff. Here's what I'm seeing: C:\GitProject\DiffTestProject [master +0 ~1 -0]> git diff diff --git a/a.txt b/a.txt index 07d4aba..e9944e6 100644 Binary files a/a.txt and b/a.txt…
King Jk
  • 1,069
  • 14
  • 22
0
votes
1 answer

git diff name only A M and D meaning

I did git diff --name-only commit1 commit2 and I get a list A file1 M file2 D file3 What does the A, M, and D stand for? Thanks
Badmiral
  • 1,549
  • 3
  • 35
  • 74
0
votes
1 answer

A git diff for what's new/modified/deleted from my current branch

I've been playing with git diff a little bit and I can't seem to find a way to compare two branches for new/modified/deleted files coming only from my branch. Let's says we got master and dev, which is the branch I'm working on. I would like to git…
ALOToverflow
  • 2,679
  • 5
  • 36
  • 70
0
votes
0 answers

make git diff output changed function names only

I notice that when I do git diff it would display the function name that was changed... Is there a way to make it so that it ONLY lists the function names that got changed and not the other diff contents Ie. I'm looking for something similar to the…
pillarOfLight
  • 8,592
  • 15
  • 60
  • 90
0
votes
1 answer

Advanced compare in GIT

Hello I would like to compare in git two projects. My MAIN project with my employee project but without one folder. Anybody knows how can I do it ?
0
votes
2 answers

How to view the changes of a Git branch

I have feature/bug-fix branch (say topic) with a bunch of commits and want to present them to my colleagues before merging them into master. I can manually find the common ancestor of my branch and the master branch and compare that to its tip: $…
Bengt
  • 14,011
  • 7
  • 48
  • 66
0
votes
0 answers

Git diff from remote location

Not sure if this is possible, I have a repo with beanstalk, I have it setup on a production server, just for pulls. I have another on my development server, where I do all the changes and push to master. The development server is running ubuntu, the…
0
votes
2 answers

Git diff - how to get different files (only name) between two tags by 'git diff' and order by the file commit time

Through the command: $git diff --name-status tag1 tag2 -- target-src The output is like: M src/config.h M src/createTable.sql A src/gameserver/BattleGround_10v10.h M src/gameserver/CMakeLists.txt M …
zoorz
  • 15
  • 1
  • 6
0
votes
1 answer

Git - How to save diff to file when diff.external tool is configured?

I've configured my git to use Meld as the diff tool: git config --global diff.external /home/myname/diff.py When I'm trying to save a diff to a file by: git diff > file.diff Meld is opened and the diff is not saved. How can I save the diff to a…
Roy Tsabari
  • 2,000
  • 6
  • 26
  • 41
0
votes
1 answer

python program works fine from command line and as git difftool, but dies as external-diff

Here is the program running normally, it is dying but for a good reason (because files a and b do not exist). % dmp_diff a b {'LESS': '-R', 'LC_CTYPE': 'en_US.UTF-8', 'SHELL': '/usr/local/bin/zsh', 'LOGNAME': 'lust', 'USER': 'lust', 'HOME ':…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
0
votes
1 answer

Showing which files that match a specific pattern have changed between git branches

I want to merge two branches but before, I'd like to review the changes between the two branches on all files whose filename ends with .twig. Is it possible, or should I use some bash-magic like git diff --name-only branch1..branch2 | grep .twig ?
cpa
  • 3,742
  • 4
  • 16
  • 22
0
votes
0 answers

Git diff seems to ignore the diff.external variable

I have been using visual diff tool (opendiff) with a wrapper script and set the diff.external variable to point to it for some time now. Recently I decided to try delta walker because opendiff just wasn't feature rich enough for my workflow. I used…
tehwallz
  • 134
  • 9
0
votes
1 answer

git command to compare current working directory and another commit

I have a modified file on my current working directory called file.txt. I want to compare it with a version of it on debug branch. The following command does not work: git diff file.txt debug:file.txt fatal: Path 'file.txt' exists on disk, but not…
Forethinker
  • 3,548
  • 4
  • 27
  • 48
0
votes
1 answer

Git: Diff a list of files

Is it possible to add a list of files somewhere to a changelist or file or something, and to run git diff commit1 commit2 myListOfFiles and to get the diff of just that list of files? Or is it possible to create a macro that expands to that list?…
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
0
votes
2 answers

Comparing a commit to its parent to see changes to a file

When you run git diff (specific commit)^..(specific commit), or in other words when you compare a commit to its parent, how do you know what was changed on the file. What does the change for that specific commit look like?
user2423347