Flatten pushed commits in devel?!?

28 views
Skip to first unread message

Edward K. Ream

unread,
Sep 5, 2019, 5:31:09 PM9/5/19
to leo-editor
Don't panic.  This is only a test.  I created the rebase-test branch as follows:

git checkout -b rebase-test
git push origin rebase
-test
git rebase
master --strategy-option=theirs

The last line took almost 10 minutes.  In this branch, gitk show all work since July 6 (the last commit to master) in a flat, linear, list of commits. Note that "theirs" has a reversed meaning from merges.

I am tempted to flatten devel this way!  Yes, I am aware that the conventional wisdom is that one must never rewrite history in pushed commits.  Otoh, what good is history if it's a spaghetti bowl?

Don't panic.  For now, flattening devel seems too drastic and dangerous.  Instead, I plan to use rebase instead of merge in future work.

What do you think? Your comments, please.

Edward

Edward K. Ream

unread,
Sep 5, 2019, 5:32:46 PM9/5/19
to leo-editor
On Thursday, September 5, 2019 at 4:31:09 PM UTC-5, Edward K. Ream wrote:

I created the rebase-test branch as follows:

git checkout -b rebase-test
git push origin rebase
-test
git rebase
master --strategy-option=theirs

 I forgot to mention that rebase-test is based on devel, not master.

Edward

Edward K. Ream

unread,
Sep 6, 2019, 5:45:44 AM9/6/19
to leo-editor
On Thu, Sep 5, 2019 at 4:31 PM Edward K. Ream <edre...@gmail.com> wrote:
Don't panic.  This is only a test.  I created the rebase-test branch as follows:

git checkout -b rebase-test
git push origin rebase
-test
git rebase
master --strategy-option=theirs

The last line took almost 10 minutes.  In this branch, gitk show all work since July 6 (the last commit to master) in a flat, linear, list of commits. Note that "theirs" has a reversed meaning from merges.

I did push this briefly to origin, but then I thought better of it and deleted the branch.

I you want to recreate what I did, you will find two or three conflicts, all involving the same deleted file.  To resolve the conflict, do git rm <the file>.

Edward
Reply all
Reply to author
Forward
0 new messages