4

I know I can add chunks using any of the following commands

git add -i git add --patch git add --edit 

But I can get all chunks for a file

git --no-pager diff file1 > /tmp/stageme 

I can see three chunks I want only the first and last chunks, so I remove the second chunk the file /tmp/stageme

How I can stage those chunks in a command? I mean, how can I stage the info from /tmp/stageme?

2
  • What you want is (I believe) git add -e, which has been in git since 1.6.4 so is probably in your version. Commented Jul 19, 2015 at 6:48
  • Yes I want that behavior but I want use a file for that, I dont want edit the file manually Commented Jul 19, 2015 at 6:51

1 Answer 1

2

I found I can do it the the git apply command

git apply --cached /tmp/patchme 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.