Pergunta

Eu tenho um arquivo que eu venho trabalhando e, em seguida, percebi que eu tinha um erro em que algumas linhas acima, onde eu tenho trabalhado. Eu rapidamente corrigido o erro e quero cometê-lo antes de me comprometer o resto do meu trabalho. Grande, este é o lugar onde add git --patch vem!

Exceto, eu estou sendo apresentado com apenas um pedaço incorporando ambas as mudanças. É possível dizer manualmente git que eu quero dois pedaços?

Foi útil?

Solução

Além de 'y' e 'n', uma das respostas que você pode dar, quando se lhe pergunta sobre um pedaço é 's', para 'dividir este pedaço para pedaços menores'. A lista completa:

y - stage this hunk
n - do not stage this hunk
q - quit, do not stage this hunk nor any of the remaining ones
a - stage this and all the remaining hunks in the file
d - do not stage this hunk nor any of the remaining hunks in the file
g - select a hunk to go to
/ - search for a hunk matching the given regex
j - leave this hunk undecided, see next undecided hunk
J - leave this hunk undecided, see next hunk
k - leave this hunk undecided, see previous undecided hunk
K - leave this hunk undecided, see previous hunk
s - split the current hunk into smaller hunks
e - manually edit the current hunk
? - print help

Outras dicas

git gui lhe permitirá cometer linhas simples, mesmo se eles são cercados por outras linhas modificadas que você não quer se comprometer.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top