Okay, one more... Ever commit something only to immediately realize that you're on the wrong branch? Use "git move <branch>".
Again, only one is necessary if you use proper commands like branch and reset.
"proper" 🤔 But, yes, branch instead of checkout -b, avoids the three checkout dance. branch/reset/checkout indeed works... like this:
Why the "soft" checkout? My assumption would be the "incorrect" commit is not supposed to be on current branch and as such can be removed.
It's going to be removed when you checkout the other branch (it's gone if you return), but otherwise it unstages everything.
Hmmm. Should be able to include optional second argument to specify number of commits to "move", too. Bonus.
United States Tendências
- 1. New York 1.09M posts
- 2. #questpit 21.7K posts
- 3. Van Jones 8,704 posts
- 4. Neal Katyal N/A
- 5. Sauer 4,233 posts
- 6. $LMT $450.50 Lockheed F-35 N/A
- 7. 5th of November 23.5K posts
- 8. $SENS $0.70 Senseonics CGM N/A
- 9. IEEPA 2,800 posts
- 10. Lina Khan 1,242 posts
- 11. #5SOS_SELFIEDAY N/A
- 12. Gorsuch 3,115 posts
- 13. Miss Piggy 3,444 posts
- 14. #wednesdaymotivation 2,871 posts
- 15. Alito 8,376 posts
- 16. $APDN $0.20 Applied DNA N/A
- 17. #Wednesdayvibe 2,156 posts
- 18. The GOP 317K posts
- 19. Balmain 4,175 posts
- 20. Socialism 125K posts
Something went wrong.
Something went wrong.