git/list[1] front-page[2] threads[3] people[4] search[5] about
 

unable to checkout branches and proper procedure for creating a new branch based off of another one

From
TAThomas Anderson <zelnaga@gmail.com>
Date
Jun 17, 2010, 02:41 UTC
Message-ID
<AANLkTilZ6zoByCngAGoCbgQ9yd424VcChpTKh_XLnogd@mail.gmail.com>

Say there's a Git repository with two branches: default (which is the default branch) and branch. I want to checkout branch and start working on that but am unsure of how to do it. Here are the commands that I did:

git clone git@github.com:username/repo.git cd repo git checkout branch

But that gets me the following error:
fatal: Not a git repository (or any of the parent directories): .git
I do "git branch" and here's what I see:
* default
Where's "branch"?

And let's say I wanted to create my own branch based on "branch". Let's say "branch-zelnaga". How would I do that? Do I just checkout that branch, create a new branch while the current working directory contains files from the desired branch and then push / commit as appropriate?

Next: Thomas Anderson
Message 1 of 4 in “unable to checkout branches and proper procedure for creating a new branch based off of another one”
  1. Thomas AndersonJun 17, 2010
  2. Thomas AndersonJun 17, 2010
  3. Thomas AndersonJun 17, 2010
  4. Gabriel FilionJun 17, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.