RE: PATCH: improve git switch documentation
- From
- Kerry, Richard <richard.kerry@atos.net>
- Date
- Jul 12, 2021, 10:31 UTC
- Message-ID
- <AS8PR02MB730258D0643373CB476A18D39C159@AS8PR02MB7302.eurprd02.prod.outlook.com>
- In-Reply-To
- <87bl78eqv3.fsf@osv.gnss.ru>
Show 5 quoted lines
> > git branch switch > > git tag switch // detach > > git commit switch // detach > > Why? You don't switch tags or commits. You switch only branches,
Yes you do. You can switch to branches, tags or commits.
If I remember correctly, "branch" is used in Subversion and CVS only for the creation of a branch. Likewise "tag" for creating a tag. And I think they both use "update" to load the required branch/tag/commit into the current working area.
If git were to do that then I think we might get around some of this confusion.
In that case: git branch = create a branch git tag = create a tag
And then a new "update", so: git update <branchname> = make the current working area contain a copy of the given branch, and similarly "git update <tagname>" or "git update <commit-id>"
In all these cases the keyword after "git" is definitely a verb, even where the actual word used could be either, and you need to look at all the definitions in the dictionary to check.
Regards, Richard.