Okay, one more... Ever commit something only to immediately realize that you're on the wrong branch? Use "git move <branch>".

coderabbi's tweet image. Okay, one more...
 
Ever commit something only to immediately realize that you&apos;re on the wrong branch?
 
Use &quot;git move &amp;lt;branch&amp;gt;&quot;.

It's pick your poison, really. Here's the same end result using cherry-pick:

coderabbi's tweet image. It&apos;s pick your poison, really. Here&apos;s the same end result using cherry-pick:

It *would* have the advantage of saving the metadata from the original commit, but that's three checkouts, so likely much slower.


Also this way, any uncommitted changes remain uncommitted after copy.


Yep (though somewhere in the thread, I wrapped the original in a stash & pop, so same result).


United States Trends
Loading...

Something went wrong.


Something went wrong.