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 الاتجاهات
- 1. Scream 7 28.9K posts
- 2. 5sos 13.2K posts
- 3. $GHOST 3,851 posts
- 4. Animal Crossing 22.3K posts
- 5. Ryan Clark 1,134 posts
- 6. Matt Rhule 2,624 posts
- 7. Somalia 53.3K posts
- 8. Necas 1,507 posts
- 9. #WomensWorldCup2025 25.1K posts
- 10. #INDWvsAUSW 51.7K posts
- 11. Happy Halloween 236K posts
- 12. Usha 23.9K posts
- 13. Rantanen N/A
- 14. Mikko 2,493 posts
- 15. #PitDark 5,535 posts
- 16. ACNH 8,092 posts
- 17. Sidney 17.3K posts
- 18. NextNRG Inc 1,230 posts
- 19. Vance 300K posts
- 20. Sydney Sweeney 93.3K posts
Something went wrong.
Something went wrong.