[SR-Dev] commit & push into master / public branches

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Apr 23 15:29:03 CEST 2009

On Apr 23, 2009 at 13:57, Henning Westerholt <henning.westerholt at 1und1.de> wrote:
> On Thursday 23 April 2009, Henning Westerholt wrote:
> > i've tried your suggestion before commiting:
> >
> > henning at ca:~/sip-router$ git pull --ff --rebase origin master
> > config.h: needs update
> > [some other files and dirs..]
> > refusing to pull with rebase: your working tree is not up-to-date
> >
> > Perhaps this only work when i've a complete clean tree?
> I've looked earlier in the docs you provided, sorry:
> [..]
> if when trying the rebase you get something like:
> $ git pull --rebase origin master
> refusing to pull with rebase: your working tree is not up-to-date
>  it means you have some uncomitted local changes. Commit them (git add ??? && 
> git commit) and try again.
> [..]
> So i aparently need to revert all my (not yet ready) changes in order to make 
> this work.

You can use git stash to save your not yet commited changes, e.g.:

git stash "my tmp changes"


and then you have several options:
git stash apply 
# if everything is ok
git stash drop # remove saved stashs
# or
git stash pop # apply your saved changes and delete them from the stash

or even better and guaranteed conflict free, create a new branch with
 your stashed stuff:

git stash branch my_tmp_branch

but in general why would you want to update/rebase when you haven't
finished your local changes? (it's quite rare that your work-in-progress
depends on the latest commit).
If you use small commits and different branches for different work (in
case that you work on several thing in the same time) it's unlikely
that you'll hit this situation too often.


More information about the sr-dev mailing list