git setup/usage question

Mark Millard marklmi at yahoo.com
Thu Jan 28 09:44:55 UTC 2021



On 2021-Jan-27, at 22:33, Milan Obuch <freebsd-git at dino.sk> wrote:

>> . . .
> 
> With some tweaks, things are perfectly working now, for me everything
> is perfectly logical. Actually I would describe it as expected for
> using multiple worktrees, not vasting space (keeping multiple full
> repositories) and time (updating multiple repositories).

FYI: I have only one .git/ and multiple worktrees, but I did not
use --bare . One worktree is the (implicit) primary one in the
directory that contains the only .git/ . The other worktrees I
added after the initial clone.

In other words, I did what Warner suggested and documents
for that aspect, although using my own naming conventions.

I never use the same branch in more than one worktree.
All the worktrees automatically find the .git/ . And
from the .git/ materials git can also find the
worktrees for the branches that have such.

I do fetch and the --ff merge separately. I use the --ff
style so that if at some point it can not do a fast-forward
it will report that and not do something else. Without the
--ff , if such a mess-up happens, then it will instead do
something else. In other words: I have it validate the
expected type of context actually exists. (Paranoia
coverage.)

>>>> . . .
>> 
>> It looks to me like he is using a configuration (--bare)
>> outside the range FreeBSD is intending to deal with and
>> so he needs his own fairly-unique procedures for using
>> git for FreeBSD activity.
> 
> 
> I think exactly the opposite - the way I did it looks (at least to me)
> as a natural way extending simple case described in Warner's Git Primer
> if one desires to track multiple branches for whatever reason.

FYI: Warner documented using worktrees without using --bare
for the FreeBSD git context and stated that he would not
document --bare use. I tried what he documented and it
worked just fine for my use.

> I am still fine tuning my setup and gaining more experiences with git,
> but in my oppinion (and others as well, I found some articles
> mentioning exactly the same) worktrees are really powerfull tool for a
> developer, which, when used with some thinking and carefully, could
> make one's development much easier.

I am using worktrees. But I am not using --bare . So far as
I know, any differences are tied to that distinction.

> I plan to document my setup soon with simple steps to re-create it and
> some explanations as well. I do not still understand everything in
> detail, but what I tried makes me confident I can use git this way
> effectively.
> 

Cool. Sounds like you and David W. may be providing some
support for folks that want to use --bare (examples of
a couple of ways of using git with --bare for FreeBSD).

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-git mailing list