[erlang-questions] mostly a git question: how do I get my github repository back in sync?

Raimo Niskanen raimo+erlang-questions@REDACTED
Thu Oct 21 15:34:09 CEST 2010


On Thu, Oct 21, 2010 at 11:51:26AM +0200, Matthias Lang wrote:
> Hi,
> 
> I have a fork of erlang/otp on github, here:
> 
>   http://github.com/matthiasl/otp
> 
> I made a branch a few months ago, add-os-pid-to-port-info. Björn has
> since merged that branch into erlang/otp pu.
> 
> Now, I want to get matthiasl/otp back up to date with erlang/otp so
> that I can make another change, starting with R14B.
> 
>   Q1: Is there a way to bring a github repository up to date from the
>       github web interface?
> 
>       I can't find one. Maybe I missed it, maybe it's a dumb idea.
> 
>   Q2: Is this the recommended non-web way to do it?
> 
>         git clone http://github.com/erlang/otp.git
>         git push git@REDACTED:matthiasl/otp.git

That would only push the 'master' branch. And it would
re-create and download a whole new local repository.
If you append which branches to push it should work,
the -f flag might also be needed.

Using an existing repository:

For branch 'dev':
    git checkout dev
    git pull origin
    git push upstream dev
providing origin is erlang/otp and upstream is matthiasl/otp.
The push might need a -f flag.

Other variant, more forceful, 3 branches:
    git checkout dev
    git fetch origin
    git reset --hard origin/dev
    git branch -f master origin/master
    git branch -f pu origin/pu
    git push -f upstream dev master pu
For dev, git reset is used since it is checked out.

> 
>       or should I just give up and delete git@REDACTED:matthiasl/otp.git
>       and then fork a new repository? That feels wrong.
> 
> Matt
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB


More information about the erlang-questions mailing list