Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-dev] Platform repository history rewrite

Hi,

unfortunately today we had to rewrite history of the master branch of
the https://github.com/eclipse-platform/eclipse.platform repository.

If you have cloned this repository before and pulled commit 56417487
[1], please continue to read. Others can skip the rest of the mail.

To verify if you are affected:

$ git show 56417487
commit 564174870d375d2dc773d31b68bf40c04602dc97
Merge: 81f7a13cc4 02251cda8d
...

If you see that above, continue to read please.

If you pull now, you repository might be in a different state as
expected / desired, because the original master branch history was
rewritten today to fix merge issues with team and resources repositories
[2].

That might lead to confusions and may be to unexpected side effects on
creating pull requests from your clone.

I will show one possible way to fix that, there are for sure more.

DO BACKUP FIRST!

Just copy your platform repository clone to a different location before
you continue, and verify the copy is identical with original one.

Note: if you didn't used your clone for development and has no changes
in your clone, you could simply delete it in the github and clone from
the platform repository again. This is the fastest way to avoid work
below, but there is no way back if you delete your clone. So do this
only if you are really sure.

If you unsure or have some work done in your repository, below is one
way how to fix the current state. Of course you can do this much easier
with EGit from Eclipse, but it is much harder to explain. So here
instructions for the git command line.

If your git status doesn't say that the "working tree is clean", please
first save your work (stash or commit). Once git working tree is clean,
you can continue.

If you committed your changes directly on master branch, simply create a
new branch "my_work" to "keep" your work.

$ git branch my_work

# "git branch" should list your "my_work" branch now

# Checkout master branch

$ git checkout master

# Make sure working tree is really clean

$ git status

On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean

# IF YOU SEE SOMETHING DIFFERENT after git status, STOP and ask for help

# throw away all bad commits after
# commit 81f7a13cc4a4cddcb893935483dc0e5264c2c2ff

$ git reset --hard 81f7a13cc4a4cddcb893935483dc0e5264c2c2ff

HEAD is now at 81f7a13cc4 Partial revert of "Use more Tycho-pomless:
Simplify poms and delete (now) trivial poms"

# Now you can pull from origin

git pull

Note: depending on your setup and habits, you might do this differently
and might need to specify remote name on pull etc. In doubt, ask for help.

Once you've done that, you probably want to update your own github fork.
To do so, you must *force push* fixed master branch from your local
clone to your own github repository.

git push --force <your own remote repo name> master

After that you should be OK.

If you have made some commits before (on "my_work" branch or other
branches), please rebase them on master branch before pushing to github.

Have a nice weekend.

[1]
https://github.com/eclipse-platform/eclipse.platform/commit/564174870d375d2dc773d31b68bf40c04602dc97

[2] https://github.com/eclipse-platform/eclipse.platform/issues/77

--
Kind regards,
Andrey Loskutov

https://www.eclipse.org/user/aloskutov
---------------------------------------------
Спасение утопающих - дело рук самих утопающих
---------------------------------------------


Back to the top