Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git reword --force-rewrite on a public commit moves the remote-tracking branch. #516

Closed
ilyagr opened this issue Aug 28, 2022 · 2 comments · Fixed by #589
Closed

git reword --force-rewrite on a public commit moves the remote-tracking branch. #516

ilyagr opened this issue Aug 28, 2022 · 2 comments · Fixed by #589
Labels
bug Something isn't working

Comments

@ilyagr
Copy link

ilyagr commented Aug 28, 2022

Description of the bug

  1. Be on a public commit (main branch) that's synced with the remote tracking branch (origin/main)..
  2. Do git reword --force-rewrite -m Something.

Expected behavior

The tip of the main branch moves to the reworded commit, but the origin/main branch stays where it was.

Actual behavior

Both main and origin/main move to the reworded commit, which is a weird and confusing state for a git repository to be in, especially if you are the only person using it (as though somebody else force-pushed to the remote while you weren't looking)

Version of rustc

No response

Automated bug report

Same as #515

Version of git-branchless

No response

Version of git

No response

@ilyagr ilyagr added the bug Something isn't working label Aug 28, 2022
@arxanas
Copy link
Owner

arxanas commented Sep 1, 2022

Hi @ilyagr, thanks for reporting. I agree that this is strange behavior; we should definitely only move local branches. I think this also causes issues if you try to do git push --force-with-lease later because your remote-tracking branch doesn't match the remote's branch.

@ilyagr
Copy link
Author

ilyagr commented Sep 1, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants