Re:Oh Shit, Git?
by pitaj on Thursday January 16, 2025 @02:46PM
(#42729951)
I prefer just using `git switch` because it's easy to remember the flags (and the position of arguments), but you're right, there is a simpler way:
[ Parent
| on HN ]
Re:Oh Shit, Git?
by DangitBobby on Thursday January 16, 2025 @03:40PM
(#42730595)
You should also be able to do
git branch -f master origin/masterThis doesn't work if your local master was already ahead of origin
Re:Oh Shit, Git?
by DangitBobby on Thursday January 16, 2025 @03:54PM
(#42730777)
Indeed, as with all of these examples exceptions will apply and, it's a good idea to check the log before taking any such action. I believe your example also depends on exactly how many commits you've made that need to be moved. In any case, it depends on me remembering exactly what `~` signifies.
Re:Oh Shit, Git?
by lalaithion on Thursday January 16, 2025 @04:54PM
(#42731415)
Good to know! Thanks for the tip.