We all strive for clean, single purpose commits with meaningful messages. This can be difficult in practice if you’ve done a lot of debugging since...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for that !
Git is really powerful.
But I wonder who really needs this feature.
If you want clean commits, you better change things one by one. First the typo, then the others.
I can't imagine using this frequently. It would waste a lot of time.
But it's my opinion.
Thanks again for your post!
That's so interesting! For me, waiting until you've completely finished one thought to start working on something else feels like it would be more time consuming, basically turning each individual thought process into a blocking task. Separating out the changes into clean commits after my ideas have come together makes way more sense for the way my brain works.
I guess it just goes to show that people's brains work in wildly different ways!
Maybe that's because I don't (always) do clean commits 😌
Sometime, I'm in the middle of an atomic commit and I come across a typo of my colleague. I better correct it now because I won't open a ticket for that and if I don't do it now, I'll forget it.
If I'm lucky it's in a separate file and I can skip it in the commit, otherwise...
How do we call that ? Laziness ? ☺️
I also never heard of the patch command, thanks for that!
Really needed this to cleaner commits.
You changed (destroyed) functionality in first hunk - you deleted role parameter and you left assignment into role attribute.
Article has been updated to reflect this, and I added a bit about popping into your terminal's default editor to manually stage changes for commit. Thanks again for the catch!
Oh, that was an oversight on my part. Thanks for catching that. I will fix that in a bit!
Thanks for your article!
I never heard of that, nice!
Did you try creating animated gif(s) from the above steps?
It might be easier to follow.
I haven't. I actually have never made an animated gif, but that's something worth looking into, for sure!
Have a look at ttyrec/ttygif !
Nice post! I've been doing this for ages using the GitHub Desktop interface, but I'd never learned to do it with the CLI.