سؤال

I got a Git repository that I accidentally pushed a file 4 commits ago that is located in (path relative to the repository root folder): /Core/C:/testoutput/agwqe1s.xml

I did this on my Linux machine, so the actual file was created without any problem. The thing is when I go back to my Windows machine, I can't switch to the branch that has this file because the Windows just refuses to create such a folder. Ok, no problem, I deleted the file on my Linux end and commit it, but even tough it's not working. Git still tries to create this illegal file on my Windows machine, and I don't know what to do.

I know that I could remake the repo from scratch, but then I'd lost my whole commit log history, and I wanted to avoid that. What are my options over here?

هل كانت مفيدة؟

المحلول

you don't need to checkout that branch to update it. From a branch that works do this:

git fetch
git push . origin/problembranch:problembranch
git checkout problembranch

the trick is to push to the same repository. That's what the . is for.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top