git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Witten <mfwitten@gmail.com>
To: git@vger.kernel.org
Subject: Re: [Improvement?] How do you switch branches in a bare repo?
Date: Fri, 12 Mar 2010 02:09:53 -0600	[thread overview]
Message-ID: <b4087cc51003120009o7bd99609w996de02b732fbbd9@mail.gmail.com> (raw)
In-Reply-To: <4B99DEA2.6050104@uq.edu.au>

On Fri, Mar 12, 2010 at 00:26, Adam Nielsen <adam.nielsen@uq.edu.au> wrote:
> Hi all,
>
> I want to remove some commits (with git reset) from a bare repo, but they're
> not in the master branch and I can't figure out how to change branches:
>
> $ git checkout newbranch
> fatal: This operation must be run in a work tree

Commands like "git checkout" and "git reset" essentially operate on 2
aspects of a repository:

    (1) The repository's state.
    (2) The repository's working tree.

Is there any reason why these commands can't just operate on (1) in a
bare repository, thereby allowing users to use familiar commands to
get their work done?

The "git checkout" command in a bare repository should serve to select
on which branch other commands (like "git reset") operate, etc.

Michael Witten

  parent reply	other threads:[~2010-03-12  8:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-12  6:26 How do you switch branches in a bare repo? Adam Nielsen
2010-03-12  6:57 ` Johannes Sixt
2010-03-12  7:12   ` Adam Nielsen
2010-03-12  7:34     ` Johannes Sixt
2010-03-12  7:38       ` Adam Nielsen
2010-03-12  8:09 ` Michael Witten [this message]
2010-03-12 16:48   ` [Improvement?] " Jonathan Nieder
2010-03-14  6:52   ` Junio C Hamano

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=b4087cc51003120009o7bd99609w996de02b732fbbd9@mail.gmail.com \
    --to=mfwitten@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).