Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Dec 2020 11:58:35 -0300
From:      Renato Botelho <garga@FreeBSD.org>
To:        Michael Grimm <trashcan@ellael.org>, FreeBSD Current <freebsd-current@freebsd.org>, FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: HEADS UP: FreeBSD src repo transitioning to git this weekend
Message-ID:  <0bce6fd0-7a54-b90a-ac6b-24226d77a87f@FreeBSD.org>
In-Reply-To: <C47EED5D-2997-49FE-8D17-AD64E1317033@ellael.org>
References:  <CANCZdfrUsaw5jpN1ybpk0ADXdQYam0_NO0mPJd0-FMbuxPruhw@mail.gmail.com> <C47EED5D-2997-49FE-8D17-AD64E1317033@ellael.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 23/12/20 11:32, Michael Grimm wrote:
> Hi,
> 
> Warner Losh <imp@bsdimp.com> wrote:
> 
>> The FreeBSD project will be moving it's source repo from subversion to git
>> starting this this weekend.
> 
> First of all I'd like to thank all those involved in this for their efforts.
> 
> Following https://github.com/bsdimp/freebsd-git-docs/blob/main/mini-primer.md form your other mail I was able to migrate from svn to git without running into any issues.
> 
> Right now I am learning how to use git the way I sed svn before. I am just following 12-STABLE in order to build world and kernel. I am not developing, neither am I committing.
> 
> I wonder how one would switch from a currently used branch (OLD) to another branch (NEW).
> 
> With svn I used:
> 	svn switch svn://svn.freebsd.org/base/stable/NEW /usr/src
> 
> For git I found:
> 	git branch -m stable/OLD stable/NEW
> 	or
> 	git branch -M stable/OLD stable/NEW
> 
> git-branch(1):
>         With a -m or -M option, <oldbranch> will	be renamed to <newbranch>. If
>         <oldbranch> had a corresponding reflog, it is renamed to	match
>         <newbranch>, and	a reflog entry is created to remember the branch
>         renaming. If <newbranch>	exists,	-M must	be used	to force the rename to
>         happen.
> 
> I don't understand that text completely, because I don't know what a reflog is, yet ;-)
> 
> Thus: Should I use "-m" or "-M" in my scenario when switching from stable/12 to stable/13 in the near future?

git-branch is used to create/delete/rename branches.  If you want to 
switch to a different already existing branch, as svn switch does, you 
should look at git-checkout.

It can be a bit expensive due to the size of src repository so if you do 
work on multiple branches too often you can improve it using git-worktree.

-- 
Renato Botelho



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0bce6fd0-7a54-b90a-ac6b-24226d77a87f>