Thread (37 messages) flat view 37 messages, 4 authors, 2021-07-12

Re: What actually is a branch?

From: Martin <hidden>
Date: 2021-07-09 13:24:29

On 09/07/2021 02:45, Felipe Contreras wrote:
I believe we have all the semantic tools needed to write something that
is understandable by most people regardless of their conception of what a
branch is.


While writing a mail on the origin topic (improve docs), I noticed that 
the word "branch-ish" is still free.

Which would be anything that resolves to a "branch reference".

Currently this only is
- branch name.
- branchname@{upstream}

Btw, if branch-foo is tracking a local branch then
    git checkout branch-foo@{upstream}
will switch the the tracked local branch.


* "branch-ish" could be defined as:
Anything that can be resolved to a branch-name.
A branch-name is a reference to the boundary that marks the end of a 
branch.
A branch-ish can be given where a commit-ish is expected. In that case 
it can be resolved to the last commit in the branch.


There may be further need to distinguish between local and remote.

For example
   git checkout [<branch>]
When the <commit> argument is a branch name, the --detach option can be used to detach HEAD at the tip of the branch (git checkout <branch> would check out that branch without detaching HEAD).
Does not mention that it will also detach, if <branch> is the a remote 
branch name
   git checkout origin/master
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help