> On Fri, Jan 7, 2011 at 6:58 PM, Curtis Olson wrote:
>
> > I make a small test edit to a file (src/GUI/MapWidget.cxx).
> > I run "git checkout next" to return to the pristine unchanged branch that
> > tracks the head on gitorious --- but here is the output:
> > $ git checkout next
> > M src/GUI/MapWidget.cxx
> > Switched to branch 'next'
> > $ git branch
> >   maint
> >   mychanges
> > * next
> > "next" is the current branch, but the change I made in the mychanges
> branch
> > to MapWidget.cxx is still visible.
>
> > What am I missing?  Why is a change that I made in one branch being shown
> in
> > a different branch?
>

On Fri, Jan 7, 2011 at 12:34 PM, ThorstenB wrote:

>  The change you made is _not_ in any branch yet. It's just a local
> change in your filesystem. git doesn't automatically add any changes
> to a branch. Maybe you just edited the file for a temporary test. Or
> you find out the change doesn't work at all and want to revert it
> immediately. You need to explicitly add any change to a branch -
> otherwise the change isn't in git.
> So, only when you run "git add MapWidget.cxx; git commit" is your
> modified file added to the current branch.
> Running "git checkout somebranch" won't touch modified files in your
> filesystem. I actually really like this feature: you can make local
> changes and then quickly change branches to see how the changes work
> with different branches. When you're happy, you switch to the branch
> you want to commit it to and finally add and commit the change to git.
>

Hi Torsten,

Ok, this makes sense the way you explain it.

So what happens if I'm messing around with my "WildCrazyIdea-I-WantToTry"
branch over lunch, and suddenly I get a phone call and have to jump back to
doing something serious with FlightGear and need to quickly switch back to
my "RealWork" branch.

Do I have to commit my "CrazyIdea" branch changes --- no matter what
intermediate state of weirdness they are in --- before I can switch back to
the RealWork branch?

Thanks,

Curt.
-- 
Curtis Olson:
http://www.atiak.com - http://aem.umn.edu/~uav/
http://www.flightgear.org -
http://www.flightgear.org/blogs/category/curt/<http://www.flightgear.org/blogs/category/personal/curt/>
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to