Skip to main content

All Questions

Tagged with
-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 ...
xerxes's user avatar
  • 331
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 ...
wyc's user avatar
  • 143
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 &...
X13Theo's user avatar
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 ...
Steve Almond's user avatar
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 "\&...
ncy's user avatar
  • 1
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 ...
Codemonkey's user avatar
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 ...
LorenDB's user avatar
  • 125
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/...
Saurabh P Bhandari's user avatar
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 ...
Photon Light's user avatar
-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.
GDayan's user avatar
  • 11
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 ...
Philip Rego's user avatar
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 ...
rasen58's user avatar
  • 159
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 ...
Jim's user avatar
  • 1,459
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 ...
user1032531's user avatar
  • 1,987
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 ...
infoclogged's user avatar
  • 1,019

15 30 50 per page