[Oberon] Re (2): Git usage for A2.

peter at easthope.ca peter at easthope.ca
Sun Jun 25 18:00:00 CEST 2023


From:	Michael Schierl <schierlm at gmail.com>
Date:	Sat, 24 Jun 2023 13:53:30 +0200
> Apologies if you receive it twice.

One copy here, thanks.

Now you might think "Why did I respond to Peter's first question?"
Fortunately the list is fairly quiet these days.  =8~)

> "git clone" is just a convenience command that calls "git init", "git 
> remote add", "git fetch" and "git checkout" with the most common 
> options (in addition to making a new directory for your repository if 
> you did not specify an existing empty one). There are cases where you 
> need options that are not exposed by "git clone" so you have to go the 
> long route.

Helpful.  Thanks.

> In particular, it does not matter if you do in an empty directory ...

Git doesn't give a name to the "empty directory" does it?  "Repository 
container directory"?.

> git init
> git remote add foo https://foo
> git remote add bar https://bar
> git fetch foo
> git fetch bar

Among the three equivalent forms you gave, that one shows the foo and 
bar parallelism best.

> git checkout -b somebranch --track bar/somebranch
> git branch -D main

What about bar?
git checkout -b somebranch --track bar/somebranch

> I deleted the main branch since it points to the main branch of the 
> repository you cloned from, or an empty orphan branch in case of "git 
> init".

I need to think about that.

> fetch (lfs or not) loads data from a remote repository to your local 
> repository, and checkout makes data from your local repository 
> available in your work tree.

HYPOTHESIS: a file in the local repository is never edited directly.
A file in the work tree can be edited directly.

> "commit" will move from your staging area and/or 
> worktree to your local repository,

commit is inverse of checkout? 

> "push" will move from your local repository to remote repositories.

push is inverse of fetch?

> For completeness, "add" will move changes from your working tree to 
> your staging area, 

Staging area?  Not mentioned elsewhere.  What, where is staging area?

Thanks,                        ... P.


- 
mobile: +1 778 951 5147
VoIP:   +1 604 670 0140



More information about the Oberon mailing list