Ports tree have been migrated to git

Dimitry Andric dim at FreeBSD.org
Sat May 1 22:37:00 UTC 2021


On 1 May 2021, at 22:30, Kurt Jaeger <pi at freebsd.org> wrote:
> 
>> On 1 May 2021, at 22:08, Kurt Jaeger <pi at freebsd.org> wrote:
>> ...
>>> I just want to be back in the state where git show does not show
>>> any changes 8-}
>> 
>> git checkout origin/main
>> git branch -d main  (you might have to use -D here if it doesn't want to get rid of the branch)
>> git checkout main
>> 
>> And voila.
> 
> # 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.


> Ok, I deleted those, but then
> 
> git show
> 
> shows me details of
> 
> commit 7e1519526b60a1437ac59ecabc24fe7ff30fe127 (HEAD -> main, origin/main, origin/HEAD)
> 
> I then tried the next step:
> 
> $ 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.

In this case you should probably use "git reset --hard", like Warner
suggested. After using this, use a regular "git pull" to get your local
main branch in sync with origin/main again.

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 223 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-git/attachments/20210502/16003e13/attachment.sig>


More information about the freebsd-git mailing list