Git Help
Ted Roche
tedroche at tedroche.com
Wed Mar 10 13:43:34 EST 2010
On 03/10/2010 11:30 AM, Thomas Charron wrote:
> As a git newb, I've got a couple of questions about git which
> confuse me. Any git users who might be able to explain?
>
It's not my primary SCC, but I'll give it a shot. (Update: Looks like
Coleman's got you all set.)
> If I'm in a directory and have made local modifications, and then I
> issue a git branch, what does the branch contain a copy of if I check
> it out? The latest head? Or does the branch branch whatever I'm
> working on to a new branch, which contains a copy of the state of the
> original branch?
>
I tried out a trivial example, using git checkout -b "new_branch" to
create a branch in a working directory with unstaged changes. My working
directory, with local modifications, is the new branch. When I merge my
branches and then make a new change, then try to switch back to one of
the older branches, git refuses, with "error: Entry 'myfile.example' not
uptodate. Cannot merge."
My git book ("Pro Git" by Scott Chacon, Apress, mostly still unread, but
recommended) states that git will not let you switch to a branch in the
current working directory if it will overwrite uncommitted work.
git help <commandname> is also a good resource for basic help.
More resources: NHRuby had a great presentation on git back in April:
http://www.tedroche.com/blog/2009/05/01/nh-ruby-30-april-2009/
Nick Quaranto's slides can be found: http://drop.io/gitstarted
and the freely-distributed book is at: http://book.git-scm.com/
--
Ted Roche
Ted Roche& Associates, LLC
http://www.tedroche.com
More information about the gnhlug-discuss
mailing list