From: "Patrick Doyle" <wpdster@gmail.com>
To: git@vger.kernel.org
Subject: How to create & switch to a branch after changes have already been made?
Date: Mon, 2 Jul 2007 22:18:05 -0400 [thread overview]
Message-ID: <e2a1d0aa0707021918mb335856j278b3128203a793a@mail.gmail.com> (raw)
Suppose, hypothetically speaking, one were a long time user of CVS who
converted to subversion in the last 18 months or so, and who never
really understood branches and merging because the syntax was so
obtuse and because the projects this hypothetical person had worked
were short lived enough that (s)he never really needed to create a
branch.
Now suppose this hypothetical person was working on a new project,
decided to use git as the project's version control system, got
halfway through changing a bunch of files, wanted to commit them as
they were, since they worked, but were ugly as sin, and wanted to
clean them up before committing them back to the main line of
development.
I would tell that hypothetical person, "Gee, it sounds like a branch
is exactly what you need here". Unfortunately I don't know how to
tell the person to do the equivalent of a "svn switch" when the local
repository has been modified.
$ git branch newbranch
that works, but
$ git checkout newbranch
complains that an untracked file would be overwritten by the merge
(since one of the things that this hypothetical person may have done
would have been to do a "git mv somefile someotherfile").
What would you suggest I say to this person other than "get in the
habit of creating a new branch _any_ time you start something new".
--wpd
next reply other threads:[~2007-07-03 2:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-03 2:18 Patrick Doyle [this message]
2007-07-03 2:49 ` How to create & switch to a branch after changes have already been made? Patrick Doyle
2007-07-03 11:10 ` Johannes Schindelin
2007-07-03 14:04 ` Patrick Doyle
-- strict thread matches above, loose matches on Subject: below --
2007-07-03 3:05 linux
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=e2a1d0aa0707021918mb335856j278b3128203a793a@mail.gmail.com \
--to=wpdster@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).