[M3commit] [modula3/cm3] 4537cb: remove unused locals
wagner at elego.de
Wed Sep 2 17:23:18 CEST 2015
On Wed, 02 Sep 2015 10:01:06 -0500
"Rodney M. Bates" <rodney_bates at lcwb.coop> wrote:
> On 09/01/2015 11:42 AM, Olaf Wagner wrote:
> > On Tue, 1 Sep 2015 16:25:05 +0000
> > Jay K <jay.krell at cornell.edu> wrote:
> >> $ git pull --rebaseerror: Cannot pull with rebase: You have unstaged changes.
> >> Ugh.
> > Just commit them before you pull.
> Hmm, this is a big problem for me. When I make a commit, it is almost always a proper
> subset of edited files. The others may be independent/unrelated changes that belong
> in a separate commit, or not yet ready for prime time, or even things I need for
> local experiments that I will never commit, e.g. my local pkginfo.txt is more often
> than not altered. Stashing has baffled me, and either that or just moving files
> temporarily is a lot of work, plus tedious and error-prone.
Hm, I think stashing is exactly how git supports this use case. This is
the example from the git help which should cover your scenario
Testing partial commits
You can use git stash save --keep-index when you want to make two or more commits out of the changes in the work tree, and you want to test each change before
# ... hack hack hack ...
$ git add --patch foo # add just first part to the index
$ git stash save --keep-index # save all other changes to the stash
$ edit/build/test first part
$ git commit -m 'First part' # commit fully tested change
$ git stash pop # prepare to work on all other changes
# ... repeat above five steps until one commit remains ...
$ edit/build/test remaining parts
$ git commit foo -m 'Remaining parts'
If you don't want to choose between different changes to one file,
but only commit some files, this reduces to
git add <files to commit now>
git stash save --keep-index
git commit -m '...'
git pull --rebase
git stash pop
AFAIK this should do what you want.
You could also commit all your current work to another branch, and then
just cherry-pick several changes from that after pull --rebase.
Olaf Wagner -- elego Software Solutions GmbH -- http://www.elegosoft.com
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95
Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: not available
More information about the M3commit