FreeBSD mini-Git Primer

Warner Losh imp at
Fri Apr 9 23:46:42 UTC 2021

On Fri, Apr 9, 2021 at 5:16 PM Kevin Oberman <rkoberman at> wrote:

> The updated mini-Git Primer is now included in the Developer's Handbook.
> See Chapter 5. I have sent a number of suggestions for some non-technical
> changes to Warner, but have not heard back yet. Perhaps he didn't care for
> them.

Hmmm, I can't seem to find them in my inbox. Perhaps you could resend them
to me?

> As I am a real novice who has had to destroy my clone of the sources and
> start over twice, I find it unlikely that i will be of significant use on
> the technical side for a while. Git is philosophically very different from
> RCS/CVS/SVN and the different mindset is taking me a while to fully grasp.
> I will say that specifying a hash that is in main but not part of the
> branch you are working on is probably a rather poor idea. I probably could
> have easily fixed it, but I had no luck in finding the right incantation
> and eventually blew /usr/src away and started over. (How do you fix a
> detached clone?)

I can offer advice on that: just checkout main. when you checkout a
specific version, you'll get a detached head. One that's fine to use, but
not good to commit to. Though, I'd have to see the exact error message to
know for sure.

> I also find net/gitup a marvelous tool for replacing portsnap. In several
> ways, it is clearly superior and I look forward to seeing it in the base. I
> mean, what is simpler than:
> # gitup -c ports (just once to create the initial clone)
> #gitup ports (to update, perhaps in periodic(8))
> Of course, you do need to edit gitup.conf to select the preferred branch
> and repo site, but it's pretty obvious.

I believe we're getting quite close to importing gitup into the base even.
There's a rather widely deployed base for portsnap since it's in a lot of
people's crontabs, though, so  there's an effort afoot to see if there's
some way to continue it pulling from git.


> On Thu, Apr 8, 2021 at 1:14 AM Graham Perrin <grahamperrin at>
> wrote:
>> On 02/03/2021 06:33, Graham Perrin wrote:
>> Re: Git, shallow clone hashes, commit counts and system/security updates
>> > On 02/03/2021 05:42, Kevin Oberman wrote:
>> >
>> > Re: Panic after updating from source
>> >
>> >> On Mon, Mar 1, 2021 at 6:31 PM Michael Sierchio <kudzu at>
>> >> wrote:
>> >>
>> >>> …
>> >>
>> >> You need to be aware that the shallow clone hash will not include the
>> >> commit count which will be used in future security updates to make it
>> >> easy
>> >> to check whether your system needs to be updated or not. A full clone
>> >> does
>> >> require more space, but I was surprised at how little extra space it
>> >> requires. Warner  is updating his git mini-guide to point out this
>> >> issue.
>> >> If you run STABLE, it's a really significant concern. You can convert
>> >> the
>> >> shallow clone to a full one with "git fetch --unshallow". This will
>> take
>> >> some time to run.
>> >> --
>> >> Kevin Oberman, Part time kid herder and retired Network Engineer
>> >> E-mail: rkoberman at
>> >> PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
>> >> _______________________________________________
>> >> freebsd-questions at mailing list
>> >>
>> >
>> > … Thank you, Kevin and Warner.
>> >
>> I see the FreeBSD mini-Git Primer in the November/December 2020 edition
>> of the FreeBSD Journal
>> <>
>> (and the review copy that was publicised in September 2020).
>> For news of a future edition, if any, should I simply watch
>> <>?
>> Thanks
>> (I have another question about deep and shallow … I'll post separately
>> to freebsd-questions …)

More information about the freebsd-current mailing list