Link to home
Create AccountLog in
Programming

Programming

--

Questions

--

Followers

Top Experts

Avatar of matiascx
matiascx🇨🇳

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?

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of FishMongerFishMonger🇺🇸

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

Avatar of matiascxmatiascx🇨🇳

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~!

Avatar of FishMongerFishMonger🇺🇸

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.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of matiascxmatiascx🇨🇳

ASKER

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.

Avatar of FishMongerFishMonger🇺🇸

Try this before doing the  rebase:

git checkout public/favicon.ico

or this:

git reset --hard

SOLUTION
Avatar of FishMongerFishMonger🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of matiascxmatiascx🇨🇳

ASKER

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 !

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of matiascxmatiascx🇨🇳

ASKER

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!

Avatar of FishMongerFishMonger🇺🇸

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
Avatar of FishMongerFishMonger🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

Avatar of matiascxmatiascx🇨🇳

ASKER

Thanks for your help!

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Programming

Programming

--

Questions

--

Followers

Top Experts

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.