git merging changes to local branch

Posted by ScottS on Stack Overflow See other posts from Stack Overflow or by ScottS
Published on 2010-04-15T19:30:33Z Indexed on 2010/04/15 19:33 UTC
Read the original article Hit count: 338

Filed under:

Is it possible to merge changes from a central repo to a local branch without having to commit/stash the edits on the local branch and checkout master?

If I am working on local branch "work" and there are some uncommited changes, I use the following steps to get updates from the central repo into my working branch.

git stash
git checkout master
git pull 
git checkout work
git rebase master
git stash pop

Usually there are no uncommitted changes in "work" and then I omit the stash steps.

What I would really like is something like the following:

git pull master  (updates master while work branch is checked out and has changes)
git rebase master (rebases the updates into work branch uncommited changes are still safe)

Is there something easier than what I currently do?

© Stack Overflow or respective owner

Related posts about git