Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Sep 2023 19:48:43 -0700
From:      Alan Somers <asomers@freebsd.org>
To:        Graham Perrin <grahamperrin@gmail.com>
Cc:        freebsd-git <freebsd-git@freebsd.org>
Subject:   Re: Working with forks
Message-ID:  <CAOtMX2g%2BQsQCf9=DCr0nAGxJ-pq9BpGCgjU2KU29RDpz0fbtiQ@mail.gmail.com>
In-Reply-To: <543e12ed-bc12-ee0e-4ddf-4423fe704d78@gmail.com>
References:  <7e6a3a98-80a8-c787-fda5-65e924dbad34@gmail.com> <CAOtMX2h1tZ3oC0a%2BMbizW9xK4Ryt5AaPtA%2B1C3g%2BTO4=vYo65A@mail.gmail.com> <543e12ed-bc12-ee0e-4ddf-4423fe704d78@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 7, 2023 at 7:39=E2=80=AFPM Graham Perrin <grahamperrin@gmail.co=
m> wrote:
>
> On 07/09/2023 20:03, Alan Somers wrote:
> > On Thu, Sep 7, 2023 at 11:49=E2=80=AFAM Graham Perrin <grahamperrin@gma=
il.com> wrote:
> >> With a clone of e.g. https://github.com/freebsd/freebsd-src.git (in th=
e FreeBSD project) as a starting point: when the times come to work, locall=
y, with other people's forks, does Git (at the command line) allow an easy =
way to temporarily use the same local directory?
> > I do this all the time, if I understand the question correctly.  You
> > just need to add a separate git remote for each fork.  For example,
> > this sequence of commands will clone the FreeBSD source.  Then it will
> > fetch grahamperrin's fork.  Then it will checkout a copy of
> > grahamperrin's feature branch.  Finally, it will rebase that feature
> > branch onto a branch from the original FreeBSD repo.
> >
> > git clone git@github.com/freebsd/freebsd-src.git
> > cd freebsd-src
> > git remote add grahamperrin git@github.com/grahamperrin/freebsd-src.git
> > git fetch grahamperrin
> > git branch grahamperrin/featureX featureX
> > git checkout featureX
> > git rebase origin/stable/13
>
> Thanks.
>
> Below (an abbreviated list of branches), what am I doing wrong?
>
> % git -C /usr/src config --get remote.origin.url
> https://github.com/grahamperrin/freebsd-src.git
> % git -C /usr/src remote add jlduran
> https://github.com/jlduran/freebsd-src.git
> % git -C /usr/src fetch jlduran
>  From https://github.com/jlduran/freebsd-src
>   * [new branch] D37210                                  -> jlduran/D3721=
0
> =E2=80=A6
>   * [new branch] nanobsd-embedded-use-makefs             ->
> jlduran/nanobsd-embedded-use-makefs
> =E2=80=A6
>   * [new branch] wip-fix-comment-blah                    ->
> jlduran/wip-fix-comment-blah
> % git -C /usr/src branch jlduran/nanobsd-embedded-use-makefs
> nanobsd-embedded-use-makefs
> fatal: not a valid object name: 'nanobsd-embedded-use-makefs'
> %
>
> If it's relevant: my /usr/src originated from my fork.

I think you've got the operand order wrong.  Try

git -C /usr/src branch nanobsd-embedded-use-makefs
jlduran/nanobsd-embedded-use-makefs



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2g%2BQsQCf9=DCr0nAGxJ-pq9BpGCgjU2KU29RDpz0fbtiQ>