Questions tagged [git-diff-tree]

git-diff-tree is a git command that compares the content and mode of blobs found via two tree objects.

git-diff-tree is a git command that compares the content and mode of blobs found via two tree objects.

https://www.kernel.org/pub/software/scm/git/docs/git-diff-tree.html

22 questions
12
votes
1 answer

In Git, how can I list all files that exist in branch A that do not exist in branch B

Is there a Git command I can use that will list the names of all files that exist in one branch that do not exist in another branch? Background: Someone deleted some history and then pushed origin/master. Some team members have been saying they are…
DAC
  • 707
  • 1
  • 6
  • 20
10
votes
5 answers

Get a list of changed files and their status for a specific Git commit

I use the following Git command git diff-tree --no-commit-id --name-only -r to get a list of changed files. Unfortunately, the list doesn't specify the type of change for each file: added, modified or deleted ... etc How may I display a list…
Ashraf Bashir
  • 9,686
  • 15
  • 57
  • 82
5
votes
2 answers

How to run git diff-tree against master branch in jenkins?

I would like to be able to see which files have changed between my current branch and the master branch during a jenkins build. in my jenkinsfile i have the below code. git diff-tree -r --no-commit-id --name-only ${env.GIT_COMMIT} origin/master but…
gurpsone
  • 463
  • 7
  • 17
5
votes
2 answers

Print percentage of dissimilarity

Sometimes when you drastically change a file, it triggers a rewrite: yes | head -256 > pa.txt git add . git commit -m qu truncate -s128 pa.txt yes n | head -64 >> pa.txt git commit -am ro Result: [master 79b5658] ro 1 file changed, 128…
user4427511
3
votes
3 answers

How to list all files added to the first commit of a GIT repository?

Current status: I am using git diff-tree -r HASH to list all added, modified and deleted files in a specific commit. This worked until today. The problem: I want to list all added files in my first commit, however passing the first HASH as a…
Lawrence
  • 309
  • 7
  • 18
3
votes
2 answers

error: unmappable character for encoding UTF8 after GIT merge

After yet another git pull my project stopped building with bunch of messages: error: unmappable character for encoding UTF-8 The messages point to the copyright symbol found in some of the files headers. There are many more files with same symbol…
user656449
  • 2,950
  • 2
  • 30
  • 43
2
votes
1 answer

Filter output of git diff-tree based on file extension

git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHORT_SHA gives me the list all the files that were committed for that SHA. I am looking for a way to get a list of files with only .xml or .html extensions. I checked the documentation page -…
Ashwin
  • 12,081
  • 22
  • 83
  • 117
2
votes
1 answer

Why does git diff-tree show always show rename as add and delete

In two test commits, wherein the first had only the operation git mv file moved_file, and the second only mv moved_file moved_again_file && git add -A moved_file moved_again_file, both appear as renames in git status before commit, but in git commit…
Walf
  • 8,535
  • 2
  • 44
  • 59
1
vote
2 answers

Azure Pipelines: git diff-tree shows empty string

I am trying to get all the committed files on an Azure Build Pipeline. This is the yaml script I'm using: trigger: branches: include: - swagger_dev paths: include: - swagger_dev/swaggers/*.yaml variables: …
1
vote
1 answer

Why does `git diff-tree ` not print a result when applied to the very first commit?

I usually use git diff-tree with these options: --no-commit-id --name-status -r or --no-commit-id --name-only -r to list the added and changed files within a specific commit. I just noticed today that this command does not print a result…
Saleh Rezq
  • 193
  • 1
  • 13
1
vote
1 answer

GIT: Get all git object hashes of blobs added to the repository by a commit

Is it possible to get a list of all git object hashes of blobs which have been added to the repository by a given commit hash using the git command line tools? I already tried archiving this with the git plumbing tool git-diff-tree. Maybe it's the…
Daniel K.
  • 5,747
  • 3
  • 19
  • 22
1
vote
1 answer

Can you do a 'git diff' on 2 branches but limit it to only one directory sub-tree?

I am working on a large web project that has oodles of code for doing RESTful APIs, authentication, etc., etc. A large team does all that. I work solely on the scinetific computational kernel of the project, which is about 20 files in one…
eSurfsnake
  • 647
  • 6
  • 17
1
vote
2 answers

Need to get all file differences (added, modified, renamed) between two Git commits

I'm trying to export all files with differences between two commits, those differences being: New files (Added) Modified files Renamed files If possible, information on any deleted files Detecting renames may be a tough one as I will be doing the…
Brett
  • 19,449
  • 54
  • 157
  • 290
1
vote
2 answers

How to get any output from “git diff-tree --stdin”?

The man-page of git diff-tree suggests that I can do a combined diff (--cc) with a bunch of tree-objects of my choosing. You have to use the --stdin option for this. But I can’t get --stdin to output anything at all. Example: $ git diff-tree…
Robert Siemer
  • 32,405
  • 11
  • 84
  • 94
1
vote
2 answers

git show -- output only displays summary

I'm having trouble with all git commands that display the log/history of a repository. This issue is ONLY limitied to one of my repositories. I have several others that work just fine. For the repo with issues, I only see the summary of the commit,…
JayT
  • 35
  • 6
1
2