Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
2 votes
1 answer
61 views

Say I have four commits A, B, C and D, with A being an ancestor of B and C being an ancestor of D. I now want to verify that the changes from A to B are the same as the changes from C to D (or show ...
Caulder's user avatar
  • 459
-3 votes
1 answer
97 views

Below is the result of my directory tree: $ tree -a myapp ├── .git ├── .gitattributes └── assets └── my.ttf When I run the following command in the assets directory on my Mac Mini M4 Pro: cd ...
Carson's user avatar
  • 8,880
-2 votes
1 answer
70 views

I believe the two functions below is the same. But AI keep telling me they are different (that I think AI is wrong). get_changed_files() { local staged_files committed_files staged_files=$(git ...
Elye's user avatar
  • 61.3k
1 vote
1 answer
98 views

Summary / Question Does git diff pass arguments provided to it down through to sub commands (e.g. git grep) when invoked? For example, when calling git diff -G with an additional flag of -i as well (e....
David's user avatar
  • 131
-2 votes
2 answers
130 views

I want to prompt users in the documentation to directly review the message of a specific commit. So, I’d like to use the git diff command, as shown below: git --no-pager diff 0847759b^:path/a.cpp ...
Carson's user avatar
  • 8,880
0 votes
2 answers
142 views

I have a script which sets useful git settings and aliases, and I want to end by printing the difference between git config --global --list before and after. I'd like to show the diff in the same ...
H.v.M.'s user avatar
  • 1,746
0 votes
1 answer
119 views

I have a the following piece of code in my git repo (using git version 2.33.0.windows.2): int foo = 0; // foo is set in some manner if (foo == 1) { DoA(); DoB(); DoC(); DoD(); } if (...
Frank's user avatar
  • 2,788
2 votes
2 answers
161 views

git diff normally will not generate an output, if the two commits it compares are identical, to make it generate explicitly "the two commits are the same", I found the bash script below. ...
athos's user avatar
  • 6,517
0 votes
1 answer
120 views

I have recently learned that git diff --cached shows how the new commit during an interactive rebase conflict after resolving the conflict looks. What does git diff compare during resolving a git ...
lmixa's user avatar
  • 79
-1 votes
3 answers
192 views

I have configured P4V to work with my git difftool command. I have added (unstaged) some new files to a new folder. Is there a way I can run git difftool on the folder to show the newly added files in ...
intrigued_66's user avatar
  • 17.5k
1 vote
0 answers
27 views

I've been spoiled by GUI diff tools like meld, kdiff3 etc. Now I'm stuck having to do some git diff'ing via a terminal. If I: git difftool --tool=vimdiff HEAD~ I get pairs of files which need to be ...
einpoklum's user avatar
  • 137k
-2 votes
1 answer
168 views

I am using git to help me manage a text, and I need git to show me changes in each word as a whole, and in the punctuation and in the spacing as well. Let's say I have a sentence I hold the big target,...
JJonas's user avatar
  • 3
0 votes
1 answer
132 views

We use a common git strategy: branch from main to a feature branch. do commits in feature. if main progresses, merge it to feature. merge feature to main. I want to view the changes that happened ...
l000p's user avatar
  • 334
-2 votes
3 answers
172 views

Clarification: I'm asking about working on multiple branches in the same worktree. (I know how to work on multiple branches in separate worktrees, but that's not the question here.) Suppose I'm ...
Steve Summit's user avatar
  • 49.2k
0 votes
1 answer
98 views

This question shows many good ways to use git-mergetool to show the condition of files before a merge commit using meld: Setting up and using Meld as your Git difftool and mergetool I like the three-...
Britton Kerin's user avatar
0 votes
1 answer
66 views

I have looked at many explanations about what git diff between 2 commits does, and I am still completely baffled about the output I am getting. I believe what I am seeing is "combined format"...
mike rodent's user avatar
  • 16.1k
-2 votes
3 answers
210 views

I have a quite subtle script that's trying to patch differences from a formatted version of a text file to a "legacy" unformatted version. To help avoid issues with extraneous diffs due to ...
David Beaumont's user avatar
0 votes
1 answer
93 views

With git difftool --dir-diff, I can 'diff a whole tree by preparing a temporary copy'. However, I then lose information about renames. Here's a comprehensive example demonstrating the same. git init ...
tfpf's user avatar
  • 684
0 votes
1 answer
51 views

I am running a diff between 2 consecutive commits and the only change between them is a rename of one file without any change in content involved. If I run a show on the parent commit, I get this from ...
eftshift0's user avatar
  • 31.5k
2 votes
0 answers
128 views

Reading the git documentation and stuff online, it just mentions having the ability to change the colors of the moved lines when specifying --color-moved, but there is no mention of an option to ...
user30020824's user avatar
0 votes
0 answers
71 views

This is for a javascript app, so no UI needed. My goal is to get stats of changes between 2 commits, basically exactly what git diff --numstat does, but also, along with the additions and deletions ...
user30020824's user avatar
0 votes
1 answer
123 views

The --diff-algorithm option allows you to change how a diff is displayed - I use "histogram" to create a diffs that appear more logical to me when I'm running git on the command line. How ...
Andrew Grimm's user avatar
  • 82.3k
-5 votes
1 answer
151 views

I thought I was beginning to understand git diff. But today I did a git diff between a commit at the tip of one branch ("A") with a commit at the tip of another ("B"), where B is a ...
mike rodent's user avatar
  • 16.1k
0 votes
1 answer
56 views

I have some merge conflicts on files 'deleted by us', meaning some incoming changes target files that I previously deleted. Is there some way in git to list these files (with the intent to git rm on ...
glades's user avatar
  • 5,346
2 votes
2 answers
186 views

I want to see the changes of git diff as a directory/tree list in VS Code. I remember it used to be there earlier in the git section of editor, but I don't see that anymore. Anyone knows how it can be ...
Srajan Gupta's user avatar
0 votes
1 answer
88 views

I have the following git diff for Python code: @@ -520,7 +520,7 @@ class AreaManager: self.broadcast_ooc( f"[{client.id}] {client.showname} ({client.name}) is GM in this hub ...
user27575278's user avatar
0 votes
2 answers
58 views

I need the diff (changes based on the words) between these two simple lines: <h1>Intro line 06.03.2004</h1> and: <h1>Intro line 15.08.2024</h1> The comparison command: git ...
thomas.mc.work's user avatar
1 vote
1 answer
87 views

I know git diff --check will list all files having leftover conflict marker, but it doesn't actually show the diff. I think the command to show the diff in all files having leftover conflict marker ...
Ooker's user avatar
  • 3,394
0 votes
0 answers
77 views

If I do the following: git config diff.algorithm patience git add -p then git add -p forms its diffs using the patience algorithm. Is there any way to force git add -p to use patience as a one-off ...
LSpice's user avatar
  • 140
0 votes
1 answer
67 views

In Git, my merge is still ongoing (no commit yet). 98% of the changes that show up in git diff are related to what MERGE_HEAD (and parent history singe merge-base) brought. 1% is my work from HEAD and ...
Charles's user avatar
  • 1,329
1 vote
0 answers
56 views

I'm writing a patch for my code which mainly replaces contents within lines. I want the git diff --stat (and later git log --stat) to show me the numbers of characters, rather than lines, added or ...
einpoklum's user avatar
  • 137k
0 votes
0 answers
207 views

Is there a good way to compare the diff (so basically the diff of the diff) between two merges or even better two potential merges (aka merge requests). For some context the branching pattern: There ...
Kaesetorte's user avatar
0 votes
0 answers
72 views

I'm having a problem with Git merge. In short, I'm merging the master branch into a feature branch, essentially git checkout feature && git merge master. This is how it looks graphically: ...
d.k's user avatar
  • 4,500
0 votes
1 answer
54 views

I want to perform a comparison operation between a file which exists on disk and a file which no longer exists because I moved it. Here's the situation. I had a file which existed in a folder. Let's ...
user2138149's user avatar
  • 18.6k
2 votes
1 answer
94 views

I would like a way to log certain commits and also submit path arguments so that the diff on those paths, if any, is shown for each commit as if those path arguments were supplied like git diff -- <...
H.v.M.'s user avatar
  • 1,746
1 vote
1 answer
79 views

We have our COBOL-Sources now in GIT-repositories. During development nearly all devs are removing the cobol leading line squence numbers. So the git diff is showing all lines as changed. I want that ...
Andi S.'s user avatar
  • 339
1 vote
2 answers
118 views

When the two commits are the same, git diff generates no result. However, is there a way to make it output some text, such as "no difference in commit1 and commit2"? this is to help identify ...
athos's user avatar
  • 6,517
0 votes
1 answer
505 views

There are a few helpful [questions and answers][1] online, [1]: How to git diff on a Azure CI pipeline, but they seem to be working in a single-repository environment. I'm using one git repository for ...
HaraldJ's user avatar
  • 69
1 vote
1 answer
114 views

I want to supply my linter tool with files that changed in my branch. The list should include: files committed in my branch since branched from its parent files changed and staged files changed but ...
Lode's user avatar
  • 2,182
2 votes
1 answer
135 views

Say, I have a branch with several commits in it. In versions A and B, I have a file with mixed line endings (mostly LF, but some CRLF), and made various other changes to it. In version C, I made ...
Some Guy's user avatar
  • 588
1 vote
1 answer
216 views

After doing a merge which includes changes of a coworker, I want to them, to outline wheat each of us changed and how I resolved the conflicts. The standard way that git displays merges, however, is ...
akraf's user avatar
  • 3,285
0 votes
0 answers
51 views

I am comparing two folders, one I pulled down from GitHub and one that I've been working on locally and would like to push. DiffMerge displayed the files as different, as expected, so I went in and ...
phil-daniels's user avatar
1 vote
0 answers
46 views

During a merge with git 2.42.0.windows.2 and the Bash console, I had to manually perform some modifications to get it to compile, which I then committed along with the modifications due to the merge ...
Charles's user avatar
  • 1,329
0 votes
1 answer
112 views

I'm working on a large and complex corporate project and I'm encountering an issue with Git and Visual Studio solution files (.sln). I have two .sln files that Git identifies as completely edited, but ...
Alessandro R.'s user avatar
1 vote
0 answers
70 views

I have a file A on branch old_branch that exists as multiple files A, B, C on a different branch new_branch. I need to merge old_branch into new_branch which would require me to resolve the merge ...
Andr0id16's user avatar
0 votes
0 answers
72 views

Im trying to list all lines that have changed in modified files only, for this I'm using the following command git diff --diff-filter=M but still, I'm getting changes for new files that have been ...
max's user avatar
  • 6,197
0 votes
1 answer
313 views

In VS Code, on Source Control view at left, you can see incoming changes grouped by commits. You can explore commits, see changed files, and examine individual changes. In IntelliJ IDEA, there seems ...
DimaA6_ABC's user avatar
1 vote
2 answers
105 views

I'm running the command git diff-index main in a repo that has the working tree equal to the branch main, but changes cached in the index. The command tells me that there are differences (I understand ...
Pablo Cárdenas's user avatar
0 votes
1 answer
104 views

I've been trying to make my git diff output nicer. Mainly I want side-by-side output, and so, I went with git-delta. Everything has been working great, but there is only one problem: git diff output ...
dxo's user avatar
  • 11
-1 votes
1 answer
126 views

I've got 2 branches I would like to merge: main and sub. In both branches there is a file called Math.java. This class contains one function on both branches: addition() on main and subtraktion() on ...
jwberlin's user avatar

1
2 3 4 5
24