![]() ![]() Theres no problem when HEAD points to a branch, but when it points to a. faultRemote=origin to always checkout remote branches from there if is ambiguous but exists on the origin remote. The HEAD updates the git checkout command to point the specified branch or commit. In Git, the detached HEAD state occurs when the HEAD does not point to a branch, but instead points to a specific commit or the remote repository. ![]() If the branch exists in multiple remotes and one of them is named by the faultRemote configuration variable, we’ll use that one for the purposes of disambiguation, even if the isn’t unique across all remotes. If is not found but there does exist a tracking branch in exactly one remote (call it ) with a matching name, treat as equivalent to: $ git switch -c -track / (In fact, you can perform the equivalent operation by invoking git checkout with the -detach argument). However, you can also check out individual commits. Apart from setting the contents of your files, it also sets HEAD to point to the commit f7884, unlike a branch in the second operation we looked at. This allows you to make new commits that will be appended to the end of that branch. ![]() If that branch matches a remote tracking one, it will create a local branch, and automatically track the remote one! Whenever you 'checkout' a new branch, Git switches the HEAD over to that branch. I made some commits and pushed to the experimental branch and everything was fine. Actually, you don't even (always) need the -create option when creating a new branch with git switch: git: switch branch without detaching head Ask Question Asked 14 years, 6 months ago Modified 3 years, 11 months ago Viewed 48k times 110 I have a repository on github with a main branch (master) and a branch for some experimental work. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |