Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a command in GIT that has the options of "git add -p" and "git checkout -p" COMBINED?

I would like to issue one command that lets me interactively either ADD a hunk, DISCARD a hunk or leave the hunk unstaged...

Actually as I know of there is only:

git add -p: ADDs hunks interactively (or leave unstaged)
git checkout -p: DISCARDS hunks interactively (or leave unstaged)

Is there a command in GIT that has the options of "git add -p" and "git checkout -p" COMBINED ?

The answer to this question provided here is not at all satisfactory : (

like image 874
arod Avatar asked Nov 14 '22 00:11

arod


1 Answers

There is no native git command that can do both. Although I do think that a better command-line hunk manager would be very useful in the git community. You should include git reset -p in your question as well, it's quite handy.

like image 188
Jason Axelson Avatar answered Nov 16 '22 00:11

Jason Axelson