cannot git clone into /usr/ports when separate filesystem

Marco Beishuizen mbeis.bsd at xs4all.nl
Tue Apr 6 13:59:57 UTC 2021


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


More information about the freebsd-ports mailing list