Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 May 2021 08:48:45 +0200
From:      Kurt Jaeger <pi@freebsd.org>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        git@freebsd.org
Subject:   Re: Ports tree have been migrated to git
Message-ID:  <YI5LTSHSY3x8CH/3@fc.opsec.eu>
In-Reply-To: <CED55ACA-B06C-4278-B7B0-EE8EFA4109EE@FreeBSD.org>
References:  <CAKBkRUzXAcXfFuD74VEPG0jAQBrmkQQdqAiBMR21vX3mA%2B4mkQ@mail.gmail.com> <YI2rkuT2W2bpPCpR@fc.opsec.eu> <CANCZdfpGx9SnSVPOBt0e5SOT0rzQbeOd%2BSZeMKTWkrXWZS3KMw@mail.gmail.com> <YI21Uht4hkDHwvvF@fc.opsec.eu> <1772D08D-CE66-4285-B8EE-2A353E7B91E2@FreeBSD.org> <YI26YFiue7%2BjCcgc@fc.opsec.eu> <CED55ACA-B06C-4278-B7B0-EE8EFA4109EE@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi!

> > # git checkout origin/main
> > error: The following untracked working tree files would be overwritten by checkout:
> >        multimedia/transcode/files/patch-import_demux__pass.c
> >        multimedia/transcode/files/patch-import_extract__ac3.c
> >        multimedia/transcode/files/patch-import_extract__mp3.c
> >        multimedia/transcode/files/patch-import_extract__pcm.c
> > [...]
> > Please move or remove them before you switch branches.
> > [...]
> 
> Ah yes, I was assuming that you were starting with a clean tree. In this
> case you could have used "git stash" to stash away the changes, and get
> them back later.

# git stash
No local changes to save

> > Ok, I deleted those, but then
> > 
> > git show
> > 
> > shows me details of
[...]
> > $ git branch -d main
> > error: Cannot delete branch 'main' checked out at '/pou/ports/default'
> > $ git branch -D main
> > error: Cannot delete branch 'main' checked out at '/pou/ports/default'
> 
> That means you are using worktrees, so indeed then you cannot delete the
> main branch, as that other location is using it.

I was not aware that I use a worktree, but this is the list of worktrees
in use:

# git worktree list
/pou/ports/default  7e1519526 [main]

git worktree remove /pou/ports/default
fatal: '/pou/ports/default' is a main working tree

> In this case you should probably use "git reset --hard", like Warner
> suggested.

# git reset --hard
HEAD is now at 7e1519526 textproc/uim: Fix incorrect use of USE_RUBY.

> After using this, use a regular "git pull" to get your local
> main branch in sync with origin/main again.

Done, now git show lists

$ git show
#ommit dc5a6492de7a0b3e79d48a02f4678c5af4467e40 (HEAD -> main, origin/main, origin/HEAD)
[...]
Again I expected that 'git show' does not display anything, as
I should be in the state of a pristine repo without anything
to show ?

-- 
pi@FreeBSD.org         +49 171 3101372                  Now what ?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YI5LTSHSY3x8CH/3>