We just had the problem that the same commit has a different hash on drupal.org and on Github. That is bad, we want a plain mirror of Github on drupal.org.

For that to work we must have a .git/config entry for origin like this:

[remote "origin"]
        url = git@github.com:fago/rules.git
        url = klausi@git.drupal.org:project/rules.git
        fetch = +refs/heads/*:refs/remotes/origin/*

(replace klausi with your username)

As you can see we have two URLs for one remote entry, and it works like this: pulls (fetches) will only be done from the first URL (Github), pushes will be done to both URLs.

That way we maintain a mirror of Github on drupal.org.

I assume fago had an extra remote for drupal.org configured and he rebased the commit accidentally, which we should not do.

I fixed the problem by performing a forced push to Github, now the branches should be identical again on both remote repositories.

Comments

klausi created an issue. See original summary.

klausi’s picture

Issue summary: View changes

typo fixed

fago’s picture

Status: Active » Fixed

Havin two remotes is fine, commit hashes are still the same.

I assume fago had an extra remote for drupal.org configured and he rebased the commit accidentally, which we should not do.

nop, problem was I forgot to attribute you the change. I wanted to fix it by amending the commit, but then I figured it's too late as I pushed to d.o. already what does not allow force pushing into the repo. So I aborted - at least I thought so - but not changing the message. But Git still amend the commit and I ended up to push another commit hash to github..

Thanks for noticing and the fix :)

subhojit777’s picture

Nice trick, thanks! You can do it using Git commands also http://stackoverflow.com/a/3195446/1233922

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.