All Questions
34 questions
1
vote
0
answers
44
views
p4merge open each window minimized when running a git diff/ merge
I've asked the question on SO before, but maybe it is better placed here.
I'm running on Ubuntu 24.04.1 LTS (X11) and have p4merge installed in version p4v-2024.3.2656785.
I'm using p4merge since ...
0
votes
1
answer
71
views
How can I call git's built-in diff command directly after configuring a different visual "git diff" substitute?
I have configured git diff to be a command that calls substitute diff for viewing file differences i.e /usr/bin/vim -dR "$2" "$3" and that doesn't work when I want to create a ...
0
votes
1
answer
126
views
Performing character-level comparison of "strings" without explicitly creating temporary files for git diff
Referring to this https://stackoverflow.com/a/31356602, I wrote this code:
#!/bin/bash
# Define the two strings to compare
string1="First string with some random text."
string2="Second ...
0
votes
1
answer
986
views
Return list using git diff and grep
I'm using git diff to return the file names of files recently changed and i'm trying to pipe the returned file names into a grep expression that searches each file and returns the files that have &...
0
votes
1
answer
386
views
Have git diff color customization
How can git diff color be changed to one's disposal, or such as for diff ...?
in ~/.gitconfig:
[color "diff"]
added = yellow
changed = red bold
not work.
Please sincere help appreciated
1
vote
2
answers
2k
views
Show differences in strings
This answer shows how to diff two strings - Using the diff command to compare two strings?
I try:
diff <( printf '%s\n' "tring1" ) <( printf '%s\n' "string2" )
The output is:...
4
votes
3
answers
3k
views
git diff: ignore comments
When using git diff, how can I ignore changes which start with # ?
For normal diff command, I would use something like:
diff <(grep -v '^#' file1) <(grep -v '^#' file2)
But none of the ...
0
votes
0
answers
103
views
Colorizing a diff of diffs in git
The setup
I wrote a script that checks if a merge commit was resolved successfully by displaying a diff of diffs before an after the merge. For example, if my history looks like this:
* 5c8cb0d2 merge ...
2
votes
2
answers
3k
views
Display git-diff between master and my last commit
I use git on a regular basis for collaboration with other people. When we work together on a shared repository, I'd like to be able to view the changes performed by others which happened between my ...
11
votes
3
answers
5k
views
grep within a git diff, but show file and line number
When I'm working on a branch, I want to quickly jump to my "TODO" comments. This means
I only want "TODO" comments that were added on my branch (ignore the ones in master)
I want ...
2
votes
0
answers
324
views
Find the (likely) git commit from which a version was branched
I have a directory containing files that were originally checked out from Git, then modified. Unfortunately, I don't have any of the Git metadata. I'd like to know what Git commit that directory's ...
2
votes
1
answer
5k
views
Is there any better way to filter the output of git diff?
SO Question in Context : Find out changed line numbers from git diff
Based on the question above, I need to print the diff for modified files between two revisions in git in this format :
/path/to/...
3
votes
1
answer
2k
views
use 'diff-highlight' for diff
I have set up diff-highlight as pager / highlighter for git.
[pager]
log = diff-highlight | less
show = diff-highlight | less
diff = diff-highlight | less
That works perfectly.
But how ...
3
votes
1
answer
745
views
How to generate (git) diffs with <n> characters of context?
The --unified=<n> option lets you set the number of lines; is there a way to do the same for characters?
example
limit the context around the changes to X character(s) when using git diff --...
-2
votes
2
answers
44
views
Filter the below text using shell commands
I am able to get the file difference using git diff command and I got it filtered like below:
-This folder contains common database scripts.
+This folder contains common database scripts.
+
+
+
+New ...