12/28/2023 0 Comments Git clone a remote branch![]() There is also a thorny problem with totally empty repositories, or you can clone with a flag that says do not create any branches, but again, you're not doing this and we don't have to worry about it. (Tag names get shared across multiple different clones, unlike branch names.) Fortunately you're not doing this so we don't have to worry about it. For instance, you can supply a tag name to your -b argument when you do this, your Git creates no branches, and with no branches, you cannot be in the normal "attached HEAD" state and so you're left in detached HEAD state, using the tag name. There are a bunch of exceptions to the above rules. They tend to recommend the branch named main or master, with the details depending on exactly who "they" are and how things are configured there. If you don't supply a -b argument, your Git asks their Git-the Git holding the repository you're cloning-which branch name they recommend. The branch name that your Git creates is the one you supply on the command line: -b branch1, for instance, tells your Git to create a local branch name branch1. That results in the normal attached HEAD state. But your git clone command ends, before returning control to you, by:Ĭreating one branch in your clone. There are many things to know about Git, too, but let's start with this one thing: When you clone an existing Git repository with git clone on the command line, you normally get all of their commits, and none of their branches. This isn't appropriate at this point as your real question is an elementary one about Git. You've tagged your question with four tags: git, github, github-actions, and github-cli. That's what you need to learn first (or at the same time). ![]() ![]() GitHub is a site that lets you store Git repositories, and that adds on a bunch of features that are not present in base Git. There is a lot here, but let's start with two things: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |