문제

Sometimes the hunks offered to you when you run git add --patch include unrelated changes mixed up with each other because the lines are physically close to each other in the file.

Is there a way to interactively add changes to the staging area on a line-by-line basis?

도움이 되었습니까?

해결책

You can type e (for 'edit') when you are adding a specific patch with mixed content (too mixed for s or 'split' to work).

That allows you to delete the lines you don't want to add.

Then you can test what you have added with a git stash --keep-index, in order to see if that is working.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top