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

On Monday 2007 May 21, Stian Haklev wrote:

What does "git --version" say?

> ~wiki/> git checkout trying-new-feature
> checked out
> ~wiki/> git status
> no files updated
> ~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.

Something has gone very wrong here.  You are right to be confused, that is not 
what one would expect from git.  After a git-checkout you should expect that 
the index is clean.

Did you get any error messages during any of those operations?

Are you sure you aren't doing something like
  git checkout trying-new-feature -- list of files
As that would update the working tree but not the current HEAD, and would 
therefore appear as changes to master.

When you do the final git-status, are the files being listed in the "Changed 
but not updated" section or the "Changes to be committed" section?

Can you make a minimal test case? e.g.
 mkdir testing-git; cd testing-git
 git init
 date > file1
 git add file1
 git commit -a -m "step1"
 date >> file1
 git commit -a -m "step2"
 git checkout -b newbranch HEAD^
 date >> file1
 git commit -a -m "step3"
 git checkout master
 git checkout newbranch
 git status



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

  reply	other threads:[~2007-05-21  9:17 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 ` Fwd: Problem: git doesn't update working dir (always) when checkout'ing other branch Stian Haklev
2007-05-21  9:16   ` Andy Parkins [this message]
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=200705211016.58067.andyparkins@gmail.com \
    --to=andyparkins@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=shaklev@gmail.com \
    /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).