git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: dloewenherz@gmail.com
To: Alex K <spaceoutlet@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: newbie question
Date: Fri, 3 Jul 2009 12:12:30 -0700	[thread overview]
Message-ID: <20090703191230.GA2446@andros> (raw)
In-Reply-To: <e4a904790907031139rc61c2e0t6b9dbbc0c3dc379e@mail.gmail.com>

Until you commit the files, the changes will follow you to whatever branch
you go to. If you don't want to commit, but still want to switch to B and
not see the changes in A, I would recommend using `git stash`.

e.g.

git checkout A
...edit...
git stash save changes
git checkout B
git status

You'll see that your tree is clean. To get your changes back to A, just run

git checkout A
git stash pop changes

Best,
Dan

On 03/07/09 11:39 -0700, Alex K wrote:
>Hello,
>
>I would think the following simple pattern would be possible:
>
>Create two branches A and B. Switch to A, modify some files, do not
>commit to A, switch to B. Now B should not show any of the changes
>performed to A? However a git status while on B does show that the
>files on A have been modified. Is there something I am missing?
>
>Thank you,
>
>Alex
>--
>To unsubscribe from this list: send the line "unsubscribe git" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-07-03 19:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-03 18:39 newbie question Alex K
2009-07-03 19:12 ` dloewenherz [this message]
2009-07-03 19:22 ` Junio C Hamano
2009-07-04  0:29   ` Sitaram Chamarty
2009-07-06 12:11     ` Michael J Gruber
  -- strict thread matches above, loose matches on Subject: below --
2010-09-23  4:59 Newbie question George Spelvin
2010-09-23  6:29 ` Thomas Hochstein
2010-09-19 23:51 kinley
2010-09-19 23:59 ` Andrew Keller
2010-09-20  0:50   ` kinley
2010-09-20  1:47     ` Imran M Yousuf
2010-09-20  6:55     ` Kevin Ballard
2010-09-20 19:32       ` kinley
2010-09-20  8:31 ` Jakub Narebski
2010-09-20  8:39 ` Alex Riesen
2006-05-16  7:03 newbie question Li Yang-r58472
2006-05-16  7:09 ` Matthias Kestenholz

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=20090703191230.GA2446@andros \
    --to=dloewenherz@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=spaceoutlet@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).