All Questions
22 questions
-1
votes
2
answers
62
views
extract multiple words from git log
I need to extract multiple words from git log.
I need the commit id and ticket number for each commit, I then need to run this through a loop and do some further processing for each commit.
commit ...
0
votes
1
answer
91
views
How to add an exact-match flag to the following git + sed function?
I want to create a bash function where you can do a sed find and replace while ignoring the files and folders in .gitignore. I also want to be able to add any git grep flags to the command. For ...
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
2
answers
57
views
How to replace duplicated multi-line groups, e.g. from git & diff3
I'm rebasing legacy code, and finding lots of conflicts caused by scripts -- usually code formatters. The changes are simple and predictable, so I can trivially re-run the script to apply the changes ...
0
votes
3
answers
619
views
grep has different result in terminal command line and bash script
I have a bash script that uses grep to screen out file with certain extensions and under certain directories. The script looks something like follows:
generate_exclud_extensions() {
echo "\&...
8
votes
1
answer
2k
views
How can I keep the color output of git status when piping it through grep?
I'm trying to compress the output of git status a bit, for a "system status" script that runs whenever I log in to an ssh session. I'm hoping it'll nag at me and encourage me to commit more ...
2
votes
1
answer
3k
views
How do I grep output from git?
I'm trying to extract the name of the folder created by git. The output says:
...
Cloning into 'repository-name'...
...
I want to pipe this output into grep to extract the one line that says Cloning ...
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/...
1
vote
1
answer
398
views
Mac OS xargs adds '?[m' at the end of line
I am trying to delete some local git branches with
git branch -D $(git branch | grep 'RTL-1[1|2|3]' | xargs)
However I am getting this kind of error
error: branch 'RTL-1114_branch_name1?[m' not ...
-4
votes
2
answers
102
views
Can someone tell me what this command does?
I have encountered the following command in an internet tutorial. I couldn't understand how it works.
git log | grep commit > ~/filename.txt
Someone please explain me how it works.
0
votes
1
answer
4k
views
How can I search terminal output?
Say I type git help to learn about the merge command. I don't want to read all the output just the lines that contain merge and their surrounding lines.
I thought this would be a common question but ...
1
vote
3
answers
377
views
Have custom grep exclude dirs for each project
I'm curious if anyone has a way to automatically generate a different set of --exclude-dir flags for grep for each different codebase that you work in.
Because in one project, I'll never want to ...
1
vote
1
answer
73
views
Getting differences of file between specific revisions/branches
I have 2 different branches A,B that have a (slightly different) version of a file X.
I am interested in getting the commits that added some specific patterns in branch B.
What I do roughly: diff ...
9
votes
1
answer
4k
views
Display filename of git diff filtered by term
-n works as a grep argument to display the line number, but -H doesn't for filename. I think it is because git diff doesn't by default output filename for each changed line. As I was typing, I ...
15
votes
6
answers
27k
views
diff to show only the additions in a changed file
Normally diff and git diff show both the original and the modified line with - and + respectively. Is there any way, I can filter only to see the modified line? This would reduce the number of lines ...