git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stian Haklev" <shaklev@gmail.com>
To: git@vger.kernel.org
Subject: Fwd: Problem: git doesn't update working dir (always) when checkout'ing other branch
Date: Mon, 21 May 2007 15:59:04 +0700	[thread overview]
Message-ID: <566574ef0705210159m69d4e32cjd4bc5db66c1677b1@mail.gmail.com> (raw)
In-Reply-To: <566574ef0705210157j14cb7c56h62392c6193472a98@mail.gmail.com>

Newbie to git, but I've been reading up on the docs and I really love
both the theory and what it let's you do (still confused by some
issues like rebasing and stuff). For now I mostly use it on my own
small projects (where I frequently make branches, merge, cherry-pick
etc), and also push it to  repo.or.cz.

One confusing thing to me is that if I am in a clean state (no updated
files in working dir), and I checkout another branch (or another
treeish), sometimes git doesn't update the working dir, and sometimes
it does. So for example in my own repo I do

~wiki/> git status
no files updated

~wiki/> git checkout trying-new-feature
checked out

~wiki/> git status
no files updated

(this is how it should be obviously - the working dir reflects the
index which is now pointing at trying-new-feature, but then...)

~wiki/> git checkout master
checked out

~wiki/> git status
it then puts me directly into commit mode, with every file having a
ton of differences - because the files are still from
trying-new-feature and the index is pointing at master.

It also seems to do inconsistent things with files that exist in only
one of the branches - ie if switching back the file remains in the
directory but is now an "untracked" file, etc.

Maybe I am completely misunderstanding and there is something I should
do differently. It works out if I do git reset --hard, but it just
seems so uneccessary. (As I said, in all cases the working dir is
completely clean before doing the checkout).

thank you
Stian

       reply	other threads:[~2007-05-21  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <566574ef0705210157j14cb7c56h62392c6193472a98@mail.gmail.com>
2007-05-21  8:59 ` Stian Haklev [this message]
2007-05-21  9:16   ` Fwd: Problem: git doesn't update working dir (always) when checkout'ing other branch Andy Parkins
2007-05-22  4:05     ` Stian Haklev
2007-05-22  8:04       ` Andy Parkins

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=566574ef0705210159m69d4e32cjd4bc5db66c1677b1@mail.gmail.com \
    --to=shaklev@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).