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.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
16 views

Gitlab CICD get changes of commit

I have a CI/CD in gitlab that checking which files where changed and build the files accordingly. This is the command I run: git diff-tree -m --no-commit-id --name-only -r $CI_COMMIT_SHA the problem ...
benrieger's user avatar
-2 votes
1 answer
56 views

Why can't I download Git and Github desktop on my system? [closed]

I am a new user to github, if anything, I only know how to log into git. Lately I've been learning React Routing taught by Bob Ziroll on FreeCodeCamp's youtube page and I have gotten to the part where ...
Chidera Lilian's user avatar
0 votes
0 answers
29 views

Is there a way to control how git highlights differences?

$ git diff -b -w --ignore-blank-lines --color-words="[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+" .../dbupgrade.sh diff --git a/.../dbupgrade.sh b/.../dbupgrade.sh index e2d2803b..b738bb64 ...
Eugen Konkov's user avatar
  • 22.8k
0 votes
0 answers
57 views

pre-commit list only conflict solved files in a merge

I have a pre-commit hook in my Git repository that runs a lint check on every .php file affected in a commit. However, this hook also runs during merge commits, affecting all files modified in the ...
André Walker's user avatar
-1 votes
2 answers
57 views

Is it possible to Git diff 2 commits and only see the diff of the files that were changed in those commit?

I have a branch where I cherry-picked a commit fd678b2 from Master for an another branch (branch-y). I had to make changes to that commit since branch-y is an old version branch and not everything was ...
this.mehhh's user avatar
0 votes
1 answer
41 views

git diff suppress "no newline at end of file"

How can I suppress the "no newline at end of file" warning in git diff? $ printf "1">1 $ printf "2">2 $ git diff 1 2 diff --git a/1 b/2 index 56a6051..d8263ee ...
hanshenrik's user avatar
  • 20.3k
0 votes
1 answer
54 views

Track Latest Merged changes

Which command can be used to compare all the changes that were made with the latest git merge to the previous changes. I have been trying to find the list of files that were changed in my latest ...
Vanz's user avatar
  • 1
1 vote
1 answer
68 views

`git diff HEAD` always shows changes where actually shouldn't

My git directory is totally clean, like this: ruqi.shang@ 13:18 monorepo % git status On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean ruqi.shang@...
Nathan Hardy's user avatar
1 vote
0 answers
10 views

Use the patience algorithm with gitk

I like to view my commit history using gitk: it's simple, it's bundled with git, and it's fast. However, it seems that gitk does not view diffs according to the algorighm specified in my git global ...
Svalorzen's user avatar
  • 5,413
0 votes
0 answers
19 views

Can Github display diffs between two tags, *within a folder*?

Suppose I have a Github project: https://github.com/tom-lord/my_awesome_app (not a real link 😉) The "main" application's code is within an app/ folder, and there are also API clients ...
Tom Lord's user avatar
  • 27.6k
0 votes
0 answers
37 views

Monaco Diff Overview not expanding when the height of the container overflows

Whenever the total size of the rendered editor exceeds the height of the outlet container, the Diff Overview panel remains the same (as shown in below image) As opposed to fitting the entire diff ...
Navin SK's user avatar
-1 votes
2 answers
39 views

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 (...
Julien Turcotte's user avatar
0 votes
0 answers
21 views

How to do >git diff --no-index file1 file2 in Gitkraken

Using the git CLI I can compare two files. If those files are untracked I can do so by using the --no-index argument: git diff --no-index file1 file2 I couldn't find a way to do so in the gitkraken (...
sebo1234's user avatar
  • 638
0 votes
0 answers
33 views

Get character level stats for git diff?

Is there a way to get the counts of added and removed characters for a commit (range)? I've found this question which relies on colors - is there a more direct way?
Cigarette Smoking Man's user avatar
0 votes
1 answer
72 views

How to see differences in a file between two branches, which I made on my branch?

I found excellent answer https://stackoverflow.com/a/4099805/4632019 I can see differences in file between branches: $ git diff my_branch..master -- the/file.md diff --git a/the/file.md b/the/file.md ...
Eugen Konkov's user avatar
  • 22.8k
2 votes
0 answers
30 views

Preview changes that would be added by a merge when there are multiple merge bases

I'm at commit F on branch main and I'd like to review the changes from branch topic-2: See the script below on how this commit history was produced exactly. Each change that is not a merge adds one ...
Feuermurmel's user avatar
  • 9,578
0 votes
0 answers
40 views

pygit2 Slow performance on Diff Patch iteration and no cache on DiffStats

It seems, pygit2 is not caching Patch and DiffStats attributes from a Diff object. Each access to these attributes re-triggers the git stats calculation. Is there a way to optimize this operation and ...
Mathieu Drapeau's user avatar
0 votes
1 answer
57 views

How to change diff source files' location in sourcetree or git?

In my development environment (LabVIEW) source files (called VIs) are interlinked. i.e., each method call is a VI call, so they are tightly depend on each other in any given project. If any ...
Ajay's user avatar
  • 33
1 vote
2 answers
121 views

git diff - git difftool - vimdiff - How to compare two files from column 1 to 72 - It's possible config one of this tools

For mainframe modernization I'm using git to modify my Cobol programs. To compare two programs one in Dev stage and another in Prod stage, I would like to compare them only from column 1 to 72. I ...
RedGoldPhoenix's user avatar
0 votes
1 answer
38 views

git see history of a specific c function that has a prototype above it in the source file

I am trying to see the history of a c function using git log, but the function is static and the source code is organized with a block of function prototypes at the top, and their definitions are ...
lluttrell's user avatar
1 vote
1 answer
290 views

Is there any way for git diff to diff files encoded in UTF-8 BOM properly?

I have a git repository in which all files are encoded in UTF8-BOM, this encoding causes nothing but problems but I have no choice on this matter. When I try to run git diff to check changes between ...
Frozen's user avatar
  • 23
0 votes
0 answers
90 views

Error saying process.send is not a function when using npm `workerpool`

I am using workerpool npm package and creating a dedicated worker to calculate git diff of two files (git-diff) When I try to run this using npm run script I am getting process.send is not a function ...
Faraz Ansari's user avatar
5 votes
2 answers
51 views

How to show differences in a commit message that was modified with "git rebase -i"?

I did a git rebase -i and reworded a commit. How do I show the diff between the new commit message that I committed and the old commit message? (e.g., from the commit in git reflog)
Rob Bednark's user avatar
  • 26.3k
0 votes
1 answer
67 views

What keyboard shortcut can I use in the Git terminal to exit out of 'git-diff' without restarting VS Code using 'CMD + Q'? [duplicate]

Good Morning everybody... Someone may help me to know which git terminal shortcut keybord should i use to exit git response after a "git diff". I actually do "CMD + Q", but still ...
DevWebWizard44's user avatar
0 votes
0 answers
29 views

How to check if the files are changed in one folder or one folder plus files outside that folder?

I have a requirement where I need to run the github actions workflow when there is a change in one folder I need to call one workflow file, if there is a change in that folder and/or other files then ...
Swathi DA's user avatar
1 vote
0 answers
49 views

Is there any way to see which commit is cherry-picked to a commit?

Assume that there are two branch develop and master. They are like this (alphabets are commits), master was created based on develop at B: A — B — C — D (develop) A — B — E — F — (C cherry-picked) — G ...
kensuke1984's user avatar
0 votes
2 answers
48 views

confused about 'git diff' and 'git show' on branch

Background: I'm on a feature branch which has diverged pretty significantly from master. I believe there are five files which have been modified on this branch. I've discovered that one of them ...
Steve Summit's user avatar
  • 45.9k
2 votes
1 answer
212 views

Dealing with a file being renamed while having new content under its old name in Git

This question begins where this one left off: Just like there, the situation is that, in one commit, a file A was renamed to B and new content was written to a file named A. The linked question asks ...
sh-at-cs's user avatar
2 votes
0 answers
215 views

How can I calculate exact total changed LOC of pull requests in a project which uses Azure DevOps (with GitPython)

I have a project which uses Azure DevOps as version control system. I want to get total changed line of code count for every pull request in the project. To do this, I send a request to Azure DevOps ...
Sergen's user avatar
  • 21
0 votes
1 answer
154 views

How to run gitlab pipelines on merge request to main

I want to implement a workflow in gitlab that runs when a pr is raised to the main branch. I used the below script but it is not working as expected. Also, I want (I want it to compare the current ...
Bunny Talks's user avatar
1 vote
0 answers
85 views

What does the "index" line mean with git diff --no-index?

I have the impression that arbitrary files on disk can be compared with: git diff --no-index path1 path2 But the output includes an "index" line with what looks like commit references. For ...
jimav's user avatar
  • 749
0 votes
1 answer
40 views

Different states with GIT DIFF

I have a file which has conflicts. REGION lifetime counter (* //for test purposes lifetimecounter goes to movement detection in set delayed outputs IF #O AND NOT #fp_lifetime AND #...
raiserle's user avatar
  • 677
0 votes
0 answers
41 views

Massaging file content for diff in Azure DevOps

I need to "massage" the contents of files before performing a diff to avoid getting a ton of changes that really aren't meaningful. We need to keep track of those changes in the source code, ...
Kevin's user avatar
  • 242
0 votes
1 answer
606 views

How do I to compare two commits of two branches? [duplicate]

Hope you're doing well. Thank you for checking out this issue of mine. I'd like to git diff two commits of two different branches like the following: git diff temp-branch/working_directory..main/...
kohane15's user avatar
  • 820
0 votes
0 answers
55 views

Is it possible to separate out sections of git diff a bit better?

This is a typical output for git diff: a3y3 $ git diff diff --git a/folder1/doc.go b/folder1/doc.go index 882hfd2..842h45f 100344 --- a/folder1/doc.go +++ b/folder1/doc.go @@ -1,5 +1,5 @@ /* -folder1 ...
a3y3's user avatar
  • 1,065
0 votes
1 answer
41 views

What are @@ -20,8 +23,8 @@ random.seed(1001) in git diff? [duplicate]

To check differences I run git diff: (reg37) C:\Users\banikr\PycharmProjects\Registration\registration>git diff master origin/master diff --git a/mainfile.py b/mainfile.py index 94a5113..4b514f1 ...
banikr's user avatar
  • 63
1 vote
2 answers
100 views

See deleted files between two git branches of specific file type

I would like to see the name of all deleted .scss files in a release branch release/1.0 compared to master branch master. I tried git checkout release/1.0 git diff --name-only master But i can see ...
johann1301s's user avatar
0 votes
0 answers
17 views

How can I stop seeing trailing whitespace at the end of lines in git? [duplicate]

We have several developers where each controls trailing whitespace differently. On an occasion I see commits that have trailing whitespace. Other than having each person removing their trailing ...
Dennis's user avatar
  • 7,947
0 votes
1 answer
45 views

after rebase, how do you review all the accepted changes?

After a long, complicated rebase involving merge conflicts and the like, it would be nice to have a look at the accepted changes all at once.
Kay V's user avatar
  • 3,798
0 votes
0 answers
76 views

Git Diff To Find Which Lines Have Been Added and Which Deleted

I have a git diff command that tells me how many lines have been deleted and added for each file between my current branch and master. Here it is: git diff master --merge-base --numstat It gives ...
Sachin Kainth's user avatar
0 votes
1 answer
59 views

Calculate changed lines same as vscode source control using git diff

I need to calculated changed lines same way as vscode source control. For example, I need to get data in next format: Line 1 deleted Lines 2,3,4,5,6,7,8 - deleted Lines 1,2,3,4,5,6,7,8,9,10 - added ...
Alex's user avatar
  • 63
0 votes
1 answer
87 views

git word-diff-regex for CSV files

I'm trying to compare two CSV files where I know the changes will be in a single column. If I compare like this, the results show red and green text for unchanged sections of text before and after the ...
Steve's user avatar
  • 1,250
1 vote
0 answers
141 views

What is Gitlab Compare API parameter straight meaning for?

In Gitlab Compare API, there is a parameter named straight. What does this parameter do? Can you give some example?
Notealot's user avatar
1 vote
2 answers
1k views

Resolving git diff error in Azure DevOps pipeline

I'm currently building the CI part of the pipeline. I've created a feature branch: git branch feature/123 git checkout feature/123 Made some changes to some files... git add . git commit -m "...
JVGBI's user avatar
  • 565
1 vote
1 answer
654 views

Gitlab CI/CD pipeline: how to run git diff between my current branch and main branch in the CI/CD pipeline?

I wanna run in a pipeline step from gitlab ci/cd a command for getting all the files changed in the current branch comparing to main branch. Unfortunately I couldn't find the proper reference for main ...
Roxana Cepoiu's user avatar
0 votes
2 answers
386 views

How can I get changed files list in my jenkins pipeline

I'm trying to get all files that changed in my branch. i tried many commands but found out that probably there is issue in my jenkins pipeline, no command return the correct list. I wanna get the list ...
Tom Cohen's user avatar
  • 153
0 votes
1 answer
185 views

Is there a way to generate a git patch of secret files (some files listed in .gitignore) so that I can apply these patch later or in other computer?

I would like to generate a patch (using git diff) of secrets files or folders in the .gitignore file that I won't versioning so that I can easily configure an entire project on another friend's ...
Alvaro Ernani's user avatar
1 vote
0 answers
89 views

Why does git diff output show only names of changed files?

I am facing a strange issue with git diff. The output of the command shows the files that were changed but does not show the exact change in the lines. It happens for both commands: git diff and git ...
Ninja's user avatar
  • 57
0 votes
0 answers
106 views

Use git diff to show only whitespace errors as defined in .gitattributes?

In .gitattributes I define what sorts of whitespaces should git diff treat as errors, for example: *.xml whitespace=trailing-space,space-before-tab,indent-with-non-tab,tabwidth=2 The whitespace in ...
metablaster's user avatar
  • 1,998
2 votes
0 answers
73 views

Finding the deleted files between two commits

I'm currently writing a script in bash to find the deleted files between a pull request and the latest tag of the destination branch of the pull request. My idea is to get the commit id of both the ...
CodeLover's user avatar

1
2 3 4 5
22