Question

I find the use of git add --patch very useful for my work-flow sometimes, like when I need to revise lots before anything is ready to commit, especially with documentation. If I have a large number of hunks to sift through, the search feature via / is helpful, but I have not discovered any way to search for the next hunk matching my regex without retyping the regex each time. Is there a way to do that?

Was it helpful?

Solution

git add is not a bash shell so you can't just recall history. Just copy the regex to your clipboard before executing it. You can then paste it in next time.

OTHER TIPS

You could try using rlwrap (which is readline for any command), e.g. like this:

rlwrap git add --patch
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top