Michael Grimm
2020-Dec-23 14:32 UTC
HEADS UP: FreeBSD src repo transitioning to git this weekend
Hi, Warner Losh <imp at 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? Thanks and regards, Michael
Lev Serebryakov
2020-Dec-23 15:04 UTC
HEADS UP: FreeBSD src repo transitioning to git this weekend
On 23.12.2020 17:32, Michael Grimm wrote:> 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?You should not use any options if you want to switch your working copy to new branch. `-m` and `-M` *renames* branch! -- // Lev Serebryakov
Warner Losh
2020-Dec-23 17:01 UTC
HEADS UP: FreeBSD src repo transitioning to git this weekend
On Wed, Dec 23, 2020 at 7:32 AM Michael Grimm <trashcan at ellael.org> wrote:> Hi, > > Warner Losh <imp at 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? >I think the answer is a simple "git checkout NEW". This will replace the current tree at branch OLD with the contents of branch NEW. git branch -m is different and changes what the branch means. If you did what you suggested then you'd be renaming the OLD brnach to NEW, which isn't what I think you're asking about. Warner