News for hackers. Stuff that matters.
Re:Oh Shit, Git? by lilyball on Thursday January 16, 2025 @05:00PM (#42731467)
The "move a branch" command is `git push .`. Yes, you can push to the current repo. I have a script called git-update-branch which just does some preflight checks and then runs `git push --no-verify . +$branch@{upstream}:$branch` to reset a branch back to its upstream version.
Re:Oh Shit, Git? by zahlman on Thursday January 16, 2025 @10:11PM (#42733696)
> The "move a branch" command is `git push .`. Yes, you can push to the current repo.

Wouldn't that copy a branch rather than moving it?

Re:Oh Shit, Git? by lilyball on Sunday January 19, 2025 @10:25PM (#42764674)
"move a branch" means changing the commit the branch points to. `git push . $sha:$branch` will update $branch to point to $sha (you'll probably want to force this, unless you're just fast-forwarding the branch).