How to resolve You are trying to rewrite {N} public commits
error?
#988
Unanswered
andresoto-x
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Steps to reproduce. $ git sl
◇ 72381e6 1h (main)
$ echo test > test
$ git add .
$ git commit --amend --no-edit
$ git sl
◇ abc1234 6m (main) main description
$ git checkout -b foo
$ echo foo > foo
$ git add .
$ git commit --m "foo"
$ git sl
◇ abc1234 6m (main) main description
┃
◯ 3ceab8a 4m (foo) foo
$ git checkout -b foo2
$ echo foo2 > foo2
$ git add .
$ git commit -m "foo2"
$ git sl
◇ abc1234 6m (main) main description
┃
◯ 3ceab8a 4m (foo) test
┃
● a49bbd9 25s (ᐅ foo2) foo2
$ git co main
$ git pull
$ git sl
⋮
◇ 987654 6m commit before main
┣━┓
⋮ ✕ abc1234 6m (rewritten as 123456) main description
⋮ ┃
⋮ ◯ 3ceab8a 4m (foo) test
⋮ ┃
⋮ ◯ a49bbd9 25s (ᐅ foo2) foo2
⋮
◆ 123456 4s (ᐅ main) main description
$ git restack
You are trying to rewrite 1 public commit, such as: 123456 main description
It is generally not advised to rewrite public commits, because your
collaborators will have difficulty merging your changes. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Im running into the following issue when I run
git restack
. I have a chain of branches and was modifying one of the intermediate branches.Beta Was this translation helpful? Give feedback.
All reactions