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. Prince Andrew 23.3K posts
- 2. Ryan Clark 2,543 posts
- 3. $AMZN 47.2K posts
- 4. Sydney Sweeney 105K posts
- 5. Scream 7 41.1K posts
- 6. Rhule 5,222 posts
- 7. #Prop50VoteYes 4,324 posts
- 8. Happy Halloween 44.8K posts
- 9. Usha 31.5K posts
- 10. Somalia 58.6K posts
- 11. Necas 2,686 posts
- 12. $AAPL 82.2K posts
- 13. Andrew Mountbatten Windsor 5,381 posts
- 14. Poot 11.4K posts
- 15. Royal Lodge 5,709 posts
- 16. Bill Kristol 1,354 posts
- 17. Animal Crossing 30.9K posts
- 18. Buckingham Palace 5,777 posts
- 19. NextNRG Inc 2,198 posts
- 20. Heritage 41.8K posts
Something went wrong.
Something went wrong.