Splitting a Single Commit into Multiple Commits (Part 1)

preview_player
Показать описание
In this video, we are going to take a look at how to split a single git commit into however many commits that you want.

I'll take you through a simple example so you can go ahead and apply the technique on your projects right away!

Editing/Post-Prod by: Lazo Živković
Рекомендации по теме
Комментарии
Автор

Some explanation about *git add -p* or git add --patch, Git will prompt you to review the changes in each file that has been modified since the last commit. For each change, you will be presented with several options:

y to stage the change
n to leave the change unstaged
q to quit the patch mode
a to stage this hunk and all the remaining hunks in the file
d to do not stage this hunk nor any of the remaining hunks in the file
e to manually edit the hunk

This allows you to be very precise about what you want to include in the next commit.

wimdenherder
Автор

Nice, it would be helpful if you could put a link to the command history, keep it going!

aleksagordic
Автор

this video is simply rubbish... that's not what happens in 99% of the cases, if you want to split a commit, you have to split using rebase, because it's very likely that the commit you want to split is way down in your commit tree. waste of time watching it

afonsosalbrecht