![]() It leads to be in detached HEAD state, not on any branch. Git checkout origin/another_branch succeeds if origin/another_branch exists. origin is mostly used in git fetch, git pull and git push as a remote, an alias of the url to the remote repository. If origin is a revision and another_branch is a file, then it checks out the file of that revision but most probably that's not what you expect. Git checkout origin another_branch returns error in most cases. If neither exists, git checkout another_branch returns error. That's to create another_branch from origin/another_branch and set origin/another_branch as the upstream of another_branch. ![]() ![]() ![]() If another_branch does not exist but origin/another_branch does, then git checkout another_branch is equivalent to git checkout -b another_branch origin/another_branch git branch -u origin/another_branch. If another_branch already exists locally and you are not on this branch, then git checkout another_branch switches to the branch. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |