Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot pull with rebase

Tags:

git

git-rebase

I get this message:

Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.

Yes, I have changes which are not committed. I searched a way to rebase my uncommitted changes on top of the new code which I would get from a pull.

I found this: https://github.com/aanand/git-up

I want to know if this is still the way to go, or if there are more modern ways to go.

I use git version 1.8.1

like image 771
guettli Avatar asked Sep 17 '13 14:09

guettli


1 Answers

git-up is probably the more sophisticated way to solve this issue.
Otherwise, you need to stash, rebase and stash pop.

The "more modern way" will be available in git 1.8.5 (or 1.9, Q4 2013).
As I mention in "Git - How to edit old (not previous) commit with some of the unstaged changes from current index (current state)?":

"git rebase" learned "--[no-]autostash" option to save local changes instead of refusing to run (to which people's normal response was to stash them and re-run).


Since Git 2.9 (June 2016), you now have (as commented by artofwarfare):

git pull --rebase --autostash
like image 106
VonC Avatar answered Sep 22 '22 09:09

VonC