I hope any time I suggested "git rebase -i ..." to rewrite/edit history I
mentioned
"before you push"... That's the intention: history should only be rewritten
*before* it goes public. If I had omitted that any time, sorry about that,
but that's the established practice: already-pushed-and-published history should
not be changed. There are a lot of reasons for it, one of which is that it will
disrupt others' work basing on yours, the other important reason is a matter of
security - changing history also changes the sha1 checksum
of the head, which is also a garantee that everything upto that point
is alll signed-off and accounted for. (and that also ties into the 'others'
work based
on yours' idea, based on a secured point in your history).
If you have recovered things correctly, your current HEAD should contain
any previously pushed/published HEAD, so "git log HEAD..<previous_pub_HEAD>"
should show nothing. The syntax A..B means any commits in B which
is not in A - if A is a direct decendent of B and therefore contains B, then
A..B
is nothing. The "previous_pub_HEAD" is based on any person
who might have taken a fetch of yours. In the absence of others' input,
my most recent fetch was dc1796075ba452c8e92df5fa252aaaaf91bd0f9b, before
it broke.
okay, as far as I see, you haven't been using rebase much until recently, so
there
are only two possible restoring points - a8afe54 or a9c4423 . Both of them
satisfy "git log a8afe54..dc1796075ba452c8e92df5fa252aaaaf91bd0f9b" and
"git log a9c4423..dc1796075ba452c8e92df5fa252aaaaf91bd0f9b" shows nothing.
They differ by a small rebase and an additional commit, which all happened
within
about 2 minutes. I can assume you have not done a push between that! So
you should recover to a8afe54 .
So, you should make your HEAD commit a8afe544d1dc64adab983329149579ffdf03429d,
but keep your edits and rewrites in a new branch, let's call it
"branch_better_history"
or something of an appropriate name,
and that's commit ccfd2c742c4c3423808998ef6064132e48057d8b .
Your master, and the one you push and work on, should be based on
a8afe544d1dc64adab983329149579ffdf03429d,
while you can and should publish a new branch with the rewrite you already done
as ccfd2c742c4c3423808998ef6064132e48057d8b.
(but you should not work on the latter any further).
code-wise, the two are the same.
i.e. you should have two published branches. "git log master"
should show a8afe544d1dc64adab983329149579ffdf03429d near
the top, while "git log <appropriately_named_extra_work_branch>"
should show ccfd2c742c4c3423808998ef6064132e48057d8b near the top.
You could achieve this, by doing
git checkout -b recovered_branch a8afe544d1dc64adab983329149579ffdf03429d
git branch -m master branch_better_history
git branch -m recovered_branch master
git checkout master
git branch
The first command recovers the older work; the 2nd and the 3rd commands renames
your rewrite work into a branch and move the recovered older work into head.
The 4th and 5th should not be needed, but it is good practice to know
which branch you are on, before you push.
this is assuming you have not done any further work since
ccfd2c742c4c3423808998ef6064132e48057d8b .
--------------------------------------------
On Sun, 17/8/14, ahi <[email protected]> wrote:
Here is the
backup, I thought you meant I should use rebase to fix the
earlier commits.
--------------------------------------------
On Sun, 17/8/14, ahi <[email protected]> wrote:
I think I have
reverted it back to it's original state.How do I make
sure?
_______________________________________________
Spdx-tech mailing list
[email protected]
https://lists.spdx.org/mailman/listinfo/spdx-tech