Re: What actually is a branch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux