Link to home
Start Free TrialLog in
Avatar of matiascx
matiascxFlag for China

asked on

git pull --rebase :always complain unstaged files

Hi, I am using git to manage repo. I also use git-fat to manage images binary files. Now it is very strange, when i execute git pull --rebase command, git always complain about unstaged files. But unfornately, i have no local changes done with git status.
What happens here?How to solve that?
vagrant@homestead:~/Code/kidsit (master)$ git pull --rebase
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.
vagrant@homestead:~/Code/kidsit (master)$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
vagrant@homestead:~/Code/kidsit (master)$ git diff-files
:100644 100644 17418f46310c8eeffbf2c567e63b0a950cd5df7a 0000000000000000000000000000000000000000 M      public/favicon.ico

Open in new window

How to solve that?
Avatar of FishMonger
FishMonger
Flag of United States of America image

What about the side you're pulling from?  Are there any unstaged files on that side?
Avatar of matiascx

ASKER

Hi, sir,
The pulling from side is github. I should have not done any changes on github.
As you can say, when i execute the git diff-files, it says there is a public/favicon.ico file changed. But when i run git status, not find that favicon.ico file in the unstage area.

Any other idea?

Thanks~!
I had the same problem the first time I used --rebase and I'm trying to remember what I did to resolve it, but my memory is a bit flaky right now.  I'll try to dust off the cob webs and see if I can jog my memory.
What i know is when you have some unstaged changes locally, the git pull --rebase really printed out that information which make sense. But unfortunately, i do nothing here, and the command git status printed out nothing.
That really annoys me much.
Try this before doing the  rebase:

git checkout public/favicon.ico

or this:

git reset --hard
SOLUTION
Avatar of FishMonger
FishMonger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry, that does not work.
It seems that public/favicon.ico is a shadow which can not be handled by GIT now.
On another branch(master), I just remove git rm public/favicon.ico, and git commit, then it works.
But when i git pull --rebase origin develop, that "have unstaged files" again rises.
I do not know what happens here. It is really annoying.

Thanks !
Hi, sir,
Following your stackoverflow link, the output of one command :

vagrant@homestead:~/Code/kidsit (develop)$ git diff-files --ignore-submodules
:100644 100644 17418f46310c8eeffbf2c567e63b0a950cd5df7a 0000000000000000000000000000000000000000 M      public/favicon.ico

I am on develop branch and the git pull works well, but git pull --rebase does not work.
Also the git rebase master does not work(I have git rm that favicon.ico file, so that i want to rebase that on develop branch)

thanks!
Does it help if you put public/favicon.ico in your .gitignore file?

Or, you can try:
git fetch && git merge --ff-only origin/develop
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your help!