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 Xu hướng
- 1. Halloween 5.96M posts
- 2. #SmackDown 20.9K posts
- 3. Mookie 11.5K posts
- 4. Gausman 8,328 posts
- 5. Yamamoto 19.7K posts
- 6. #BostonBlue 1,997 posts
- 7. Heim 12.3K posts
- 8. #OPLive 1,441 posts
- 9. Grimes 5,436 posts
- 10. #NASCAR 3,783 posts
- 11. #Dateline N/A
- 12. Josh Hart N/A
- 13. Mike Brown 1,095 posts
- 14. Syracuse 3,913 posts
- 15. Josh Giddey 1,041 posts
- 16. Jamison Battle N/A
- 17. DREW BARRYMORE 2,375 posts
- 18. Drummond 3,278 posts
- 19. Connor Mosack N/A
- 20. End 3Q N/A
Something went wrong.
Something went wrong.