Linked Questions

3989 votes
27 answers
2.6m views

How do I view the history of an individual file with complete details of what has changed? git log -- [filename] shows me the commit history of a file, but how do I see the file content that changed?
Richard's user avatar
  • 41.7k
257 votes
7 answers
128k views

When I do a git diff, it shows lines that have been added: + this line is added lines that have been removed: - this line is removed but it also shows many lines which are not modified: this line is ...
r3b00t's user avatar
  • 7,643
169 votes
8 answers
44k views

Say I get a patch created with git format-patch. The file is basically a unified diff with some metadata. If I open the file in Vim, I can see which lines have been modified, but I cannot see which ...
Adam Monsen's user avatar
  • 9,554
95 votes
13 answers
75k views

Assuming I have a text file alex bob matrix will be removed git repo and I have updated it to be alex new line here another new line bob matrix git Here, I have added lines number (2,3) and updated ...
Mahmoud Khaled's user avatar
41 votes
4 answers
18k views

When I run git diff, the header part of each diff comes out in white text. Since I'm using a light background it is hard to read, so I want to change it. I have found that I can change other colors ...
TimK's user avatar
  • 4,895
28 votes
3 answers
49k views

I have this awk script that I use to filter genes that are differentially expressed. I have a csv file that was created in R. #Command to get DE genes awk -F '\t' '$14 < 0.05 && $10 < -...
degopwn's user avatar
  • 547
8 votes
1 answer
912 views

Before pushing a Git commit, I usually want to review all TODOs that I've added in the code. I've tried several approaches, but I'm still haven't found a good way to do this. E.g. with the following ...
oberlies's user avatar
  • 11.8k
0 votes
2 answers
780 views

I obtained this code sample from someone else here: git diff --color=always | \ gawk '{bare=$0;gsub("\033[[][0-9]*m","",bare)};\ match(bare,"^@@ -([0-9]+),[0-9]+ [+]([0-9]+),[0-9]+ @@",a){...
Gabriel Staples's user avatar
1 vote
2 answers
233 views

I'm studying awk pretty fiercely to write a git diffn implementation which will show line numbers for git diff, and I want confirmation on whether or not this Wikipedia page on awk is wrong [Update: I'...
Gabriel Staples's user avatar
1 vote
2 answers
583 views

Intention: Due to a heap of legacy code, I'd like to lint only lines added or changed in my Pull Requests to make the environment gradually better. Input: Name of the base branch (master), name of my ...
Honza Javorek's user avatar
2 votes
2 answers
128 views

I use TortoiseGit on Windows. Everytime I start a new commit, the following shall happen: Search for added or modified lines containing " TODO" Add these lines to the commit message (meant as a ...
Tim Pohlmann's user avatar
  • 4,501
0 votes
1 answer
87 views

Sorry if this sounds easy but I seem to be struggling with some of the more advanced GIT commands. I am basically trying to find modified line numbers in files that have not been committed yet. Just ...
kratos's user avatar
  • 2,495
0 votes
1 answer
62 views

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
  • 75