Git pull error: unable to create file (Invalid argument)
Solution 1:
I ran into the same problem, but wasn't willing to rename or delete these files. So here's a workaround in case you can live without accessing those files using a sparse-checkout:
Go to the .git
folder in your repo and open the file config
. (You can also edit your configuration using tortoise-git, but I havn't got it installed here.) In the [core]
section add the line
sparsecheckout = true
then go to the folder .git/info
and create the file sparse-checkout
. Add something like
*
!kickstarter/parsers/data/kickstarter/campaigndetails/*
The first line includes everything, while the second excludes all files in kickstarter/parsers/data/kickstarter/campaigndetails/
. You should now be able to checkout the repo. Using wild-cards you can probably do more sophisticated excludes.
Solution 2:
If I read that log well, those files have names that end with "?ref=users"
Windows does not allow you to have a '?' in a filename, just like it does not allow to have a "\" or "*". Under Linux it is possible, if you escape those characters. On Windows, I think it's not possible at all. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247
You will have a hard time with such names.. I actually can't come up with any idea that would allow you to sync that 1:1. You certainly can fetch them and save them under some safe names like _projects_1099992656_heavenly-sight-a-vision-out-of-blindness__ref=users
but I don't know how to do that automatically, or how to later inform Git about that mapping, sorry..
These filenames look like they have a HTML-query-parameters suffixed to them. Is it really required? maybe that's just some artifact that could be removed? try talking to the mantainers of the project, maybe they will be able to simply remove that odd suffix?
Solution 3:
I'm using bitbucket and it has function that you can delete a problem file.
This is what I do.
- Go to your repository.
- Choose menu "commit".
- Select your branch that you want to remove problem file.
- Go to your file and click it. You will reach the file overview that show the detail of the file e.g. your code, date time of this file committed, etc.
- Look at upper right corner, you will see the button with arrow down image (similar to alphabet v) click it.
- It will dropdown and show you rename button and delete button inside it.
- Then it's your choice, will rename it or delete it. Choose wisely.
- After you click a button. Bitbucket will show you a dialog box do as it said and commit your file with commit button.
- After commit you can return to sourcetree and pull your code with no problem.
- Enjoy!