Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Apr 2021 15:59:48 +0200 (CEST)
From:      Marco Beishuizen <mbeis.bsd@xs4all.nl>
To:        freebsd-ports@freebsd.org
Subject:   Re: cannot git clone into /usr/ports when separate filesystem
Message-ID:  <2ac15ac-75ff-8712-7bdc-14f2ff832e36@xs4all.nl>
In-Reply-To: <20210406152853.11f43bdc@bsd64.grem.de>
References:  <c0e43b7-20a4-1ba1-c7cf-3a2f95f9bd3@xs4all.nl> <202104061312.136DCggM012531@nuc.oldach.net> <20210406152853.11f43bdc@bsd64.grem.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 6 Apr 2021, the wise Michael Gmelin wrote:

>> Sorry, I forgot: git checkout main
>>
>> Once done, just regularly: git pull --ff-only
>>
>> Explanation: "clone" is roughly equivalent to "init + remote add +
>> checkout". Separating the three steps will allow for the -f (--force)
>> option on "remote add" which will ignore already existing files.
>>
>
> Kind of re-sending what I wrote earlier, as I managed to have diverging
> HTML and plain text alternatives in my previous email (facepalm).
>
> I wouldn't bother to get all these details right and instead just clone
> somewhere else and move files into place, e.g.:
>
>  cd /usr/ports
>  git clone https://git.freebsd.org/ports.git removeme
>  mv removeme/.* removeme/* .
>  rmdir removeme
>  git status
>  git pull
>
> Note that "Invalid Arguments" errors are expected on the mv command
> (this could be replaced by a fancy find command, like `find removeme \
> -mindepth 1 -maxdepth 1 -exec mv {} . \;`, but this was easier).
>
> Also, in case "git status" shows something like "Untracked filed
> .sujournal", add ".sujournal" to your global git excludes file.
>
> Example:
>
>  git config core.excludesFile=$HOME/.gitexcludes
>  echo .sujournal >>$HOME/.gitexcludes
>
> In case you don't want to override the excludesFile setting, alter one
> of the config files in the default global location
> $XDG_CONFIG_HOME/git/ignore[0].

Thanks for the help. A git checkout does get the portstree into 
/usr/ports. So cloning into another directory and copying it wasn't 
needed.

To avoid possible future problems I placed .sujournal into 
$HOME/.gitexcludes as you suggested.

So it seems to be working again.

Regards,
Marco



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2ac15ac-75ff-8712-7bdc-14f2ff832e36>