Re: git pull not replicating?

From: Mark Millard <>
Date: Sat, 18 Jun 2022 21:02:38 UTC
On 2022-Jun-18, at 13:24, Andy Farkas <> wrote:

> Thank you Michael and Mark, you have increased my understanding of git
> such that it now makes a bit more sense of what is going on. The many
> many git manpages I find hard to comprehend. (what does <tree-ish>
> supposed to mean?)
> On 19/06/2022 3:13 am, Mark Millard wrote:
>> (Deleting/moving directory
>> trees from the likes of inside /usr/ports is a
>> valid type of development operation.
> I see. That makes sense.
>> "git -C /usr/ports pull" is basically a sequence
>> ( I made the command explicit about /usr/ports ):
>> # git -C /usr/ports fetch
>> # git -C /usr/ports merge
> The manpage mentions this.
>> The git fetch means that you have a full copy available
>> locally...
> ... of the .git tree...

The .git repository and its representation is distinct
from your local directory tree that you normally use.
The repository has history and such not visible in
the local directory tree that you normally use.

>>  that you could check out into a directory tree...
> ... via 'git merge':

checkout and merge are different operations.

checkout is more of a replacement. (But clean -fd can
also be relevant, depending on intent.)

merge is for combining two variations into one. You had
created a context with two variations, one in your local
directory tree and one in what you had fetched.

"git -C /usr/ports pull" does not do a checkout as
its 2nd step. It does merge.

Do not take anything I wrote as any objection to the
use of other possible sequences that involve checkout.

>> The git merge has to do with updating the local
>> directory tree to deal with both already-changed
>> local content and the fetched material.
> Seems I had a misunderstanding of 'merge' and 'checkout'.
>> It is not the goal of this to do the likes of a
>> "git -C /usr/ports reset --hard HEAD".

Nor is the goal to do the likes of a checkout.

> Ah-ha!
>> A question here is if you maintain any deliberate
>> changes of your own in your tree. (Are you acting
>> like a developer at all?)
> I'm a mere mortal user... although I was once listed in the now
> non-existent FreeBSD 'Contributors' web page... ?
It lists: "Andy Farkas" under
"8. Additional FreeBSD Contributors". (You might want
the replaced?)

I've never been listed as a contributor but I do have
a few local changes (both system and ports).

You might want to fetch without merge (no pull) and
do the checkout or "reset --hard HEAD" sort of
activity separately. It does not sound like you
expect to ever want an actual merge.

(It is possible to reach back before HEAD instead if
something recent needs to be avoided.)

>> # git -C /usr/ports reset --hard HEAD
>> would destroy any deliberate changes to things
>> in your /usr/ports tree.
> Bingo!  This is what I'm after.

FYI: Do not take it as the only way.

>> git is biased to on-going development and so expects
>> to deal with differences being involved in the local
>> directory tree. It is extra work to be sure no
>> differences occur or to remove the differences when
>> unintended ones show up. It is not automatic.
> There ya go..

Mark Millard
marklmi at