git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Anderson <zelnaga@gmail.com>
To: git@vger.kernel.org
Subject: Re: unable to checkout branches and proper procedure for creating a  new branch based off of another one
Date: Wed, 16 Jun 2010 22:44:55 -0500	[thread overview]
Message-ID: <AANLkTilasCQ1_F0z8NTaJzFNvgnFGImlGN5DcOh0O7VV@mail.gmail.com> (raw)
In-Reply-To: <AANLkTillFOvwAK_rHhUjhbjRupD1DnQpcMFB3QbExctt@mail.gmail.com>

Also, directories that are present in the "branch" branch aren't
present in the current working directory, despite my having switched
over.  "git checkout origin/branch" adds the missing directories but
"git checkout -b origin/branch" does not.  Which leaves me wondering
what the latter is doing.

On Wed, Jun 16, 2010 at 10:32 PM, Thomas Anderson <zelnaga@gmail.com> wrote:
> I guess what I was trying to do was checkout a remote branch.  Of
> course, it's unclear to me what the difference between "git checkout
> origin/branch" and "git checkout -b origin/branch" is.  The latter
> creates a local branch and the former doesn't?  Does that mean that,
> with the former, changes I commit and subsequently push will get
> written to the remote default branch and not the remote "branch"
> branch?
>
> And how do I check that files in the current working directory are
> from the desired branch?  "git log" shows commits made to the default
> branch - not to the "default" branch, which doesn't give me much
> confidence...
>
> On Wed, Jun 16, 2010 at 9:41 PM, Thomas Anderson <zelnaga@gmail.com> wrote:
>> 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?
>>
>

  reply	other threads:[~2010-06-17  3:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-17  2:41 unable to checkout branches and proper procedure for creating a new branch based off of another one Thomas Anderson
2010-06-17  3:32 ` Thomas Anderson
2010-06-17  3:44   ` Thomas Anderson [this message]
2010-06-17  5:04     ` Gabriel Filion

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTilasCQ1_F0z8NTaJzFNvgnFGImlGN5DcOh0O7VV@mail.gmail.com \
    --to=zelnaga@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).