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 Tendances
- 1. Animal Crossing 9,257 posts
- 2. 5sos 10.6K posts
- 3. #Scream7 7,356 posts
- 4. Happy Halloween Eve 2,820 posts
- 5. #TheFirstDayandNight N/A
- 6. #PitDark 2,875 posts
- 7. Blake Butera N/A
- 8. Good Thursday 33.1K posts
- 9. Super Sentai 3,072 posts
- 10. Melissa Barrera 2,914 posts
- 11. Rickey 1,541 posts
- 12. #thursdayvibes 3,518 posts
- 13. Sidney 10.6K posts
- 14. ACNH 3,103 posts
- 15. #ThursdayThoughts 3,205 posts
- 16. Usha 15.2K posts
- 17. $META 40.8K posts
- 18. Happy Friday Eve N/A
- 19. Tomorrow is Halloween 2,984 posts
- 20. Heaven Can Wait N/A
Something went wrong.
Something went wrong.