Git pull error: unable to create file (Invalid argument) - windows

I am trying to sync remote repo with local repo but getting following errors. Some files (which have not extention) are not getting sync with local repo on WINDOWS machine, but I could sync successfully on MAC machine.
Is there any configuration settings in WINDOWS to handle such case?
Using TortoiseGit
Windows 7 64 bit machine
ERROR DETAILS
git.exe clone --progress -v "https://github.com/xxxx/xxxxx.git" "C:\Data\GitHub\simility\vishesh-common"
Cloning into 'C:\Data\GitHub\simility\vishesh-common'...
POST git-upload-pack (200 bytes)
remote: Counting objects: 3912, done.
remote: Compressing objects: 100% (487/487), done.
Receiving objects: 100% (3912/3912), 2.70 MiB | 567.00 KiB/s, done.
Resolving deltas: 100% (1578/1578), done.
remote: Total 3912 (delta 409), reused 0 (delta 0)
Checking connectivity... error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030050305_fantasy-trilogy-spin?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030295038_laser-dogs?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030315317_arizona-native-bird-painting-series?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030315317_native-birds-ii?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_ikeyboard-0?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_ikeyboard?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_only-you-can-prevent-computercide?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_vector-cupholder-protect-your-laptop-and-your-lap?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_103055429_death-of-an-angel?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030650665_rachel-vanslyke-making-a-new-record-together-we-ca?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030835091_russian-trucks-of-world-war-two?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1031873800_prop-expansion-next-level?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1031873800_prop-project-expansion?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1099860912_yaw-clock?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1099992656_heavenly-sight-a-vision-out-of-blindness?ref=users (Invalid argument)
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status' and retry the checkout with 'git checkout -f HEAD'
git did not exit cleanly (exit code 128) (21746 ms # 29-09-2014 13:32:13)

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.

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?

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!

For me, this error occured when I was working on Windows machine. And git repo was cloned inside One-Drive. Altimately, after changing git location to outside One-Drive worked for me. Somehow, One-Drive couldn't update the file index I was trying to commit. Either you can try outside of One-Drive location or try resetting to previous commit and then update.

In general if you get this git "invalid argument" error on Windows, try making sure your /.git/ folder is not set to "read only". This fixed it for me.

I ran into this and tried a few of the solutions above with no success.
What I did is weird but worked for me, I:
Copied all my changes for the 1 file I had issues to notepad
Reverted changes in GIT
Copied the text from notepad with my updated code
Saved the file with the changes again
Used Git Desktop to push the changes
This time it worked.
I did this for 2 different files and it worked for me at least. Easy/quick thing to try before you try the others if you only have a file or 2 causing the issues.

I was also facing "Git: unable to write file, invalid object" and try many ways but nothing has been worked. Alterably I tried simple way i have created new repo folder at my local and take checkout again of the branch and implement changes. then commit and it works.
Please note before doing just take back of the changes or if you are creating new folder for repo then dont delete till your changes committed into folder.

Something similar happened to me locally: I was suddenly unable to do git add -A and got this message:
error: unable to write file .git/objects/99/8fe363fa337daab318f7fc378727d9dcce28d5: Invalid argument
error: [some file].js: failed to insert into database
error: unable to index file '[some file].js'
fatal: adding files failed
I removed the file from the repo (temporarily copied it elsewhere), commited and pushed the repo (without the problematic file) to GitHub. Then, in GitHub, I manually added the file and commited.
At this point, pulling to my local machine failed. I deleted the directory/repo and got a fresh clone from GitHub. It's a weird solution but it seems to work.

Related

"/anaconda/lib/python3.6/site-packages/nbstripout.py": /anaconda/bin/python: No such file or directory

Any advice how to fix the following error message(s)?
Every time that I am using Terminal with Mac OS Catalina 10.15.1 I get the following output
"/anaconda/bin/python" "/anaconda/lib/python3.6/site-packages/nbstripout.py": /anaconda/bin/python: No such file or directory
error: external filter '"/anaconda/bin/python" "/anaconda/lib/python3.6/site-packages/nbstripout.py"' failed 127
error: external filter '"/anaconda/bin/python" "/anaconda/lib/python3.6/site-packages/nbstripout.py"' failed
fatal: Google Drive/Drive on my xxxx.ipynb: clean filter 'nbstripout' failed
This happened to me when I moved my git repo. I had to go into .git/config and edit the [diff .ipynb] section with the updated directory.

Unable to install package

Initially posted this on the Ethereum forum but feel that there might be more knowledge of the issue here as it is a Golang/git package installation issue
I am trying to compile smart contracts using the go-ethereum client.
I have go installed on my pc and installed ran the following commands:
go get -u github.com/ethereum/go-ethereum
cd $GOPATH/src/github.com/ethereum/go-ethereum/
make
Which all work fine.
When I run
make devtools
I get the following error:
Pros-MacBook-Pro:go-ethereum Santi$ make devtools
env GOBIN= go get -u golang.org/x/tools/cmd/stringer
# cd /Users/pro/go/src/golang.org/x/tools; git pull --ff-only
error: Your local changes to the following files would be overwritten by merge:
CONTRIBUTING.md
blog/blog.go
cmd/godoc/autocert.go
cmd/godoc/blog.go
cmd/godoc/godoc_test.go
cmd/godoc/handlers.go
cmd/godoc/main.go
cmd/godoc/x.go
cmd/goimports/goimports.go
cmd/gomvpkg/main.go
cmd/goyacc/yacc.go
cmd/guru/guru.go
cmd/guru/guru_test.go
cmd/guru/main.go
cmd/guru/referrers.go
cmd/guru/testdata/src/referrers/int_test.go
cmd/guru/testdata/src/referrers/main.go
cmd/guru/testdata/src/referrers/main.golden
cmd/present/static/styles.css
cmd/present/templates/slides.tmpl
cmd/stringer/endtoend_test.go
cmd/stringer/stringer.go
cmd/tip/tip.go
go/ast/astutil/imports.go
go/ast/astutil/imports_test.go
go/buildutil/allpackages_test.go
go/buildutil/fakecontext.go
go/buildutil/util_test.go
go/gcexportdata/example_test.go
go/gcexportdata/gcexportdata.go
go/gcexportdata/main.go
go/gcimporter15/bexport.go
go/gcimporter15/bexport19_test.go
go/gcimporter15/bexport_test.go
go/gcimporter15/bimport.go
go/gcimporter15/exportdata.go
go/gcimporter15/gcimporter.go
go/gcimporter15/gcimporter_test.go
go/gcimporter15/isAlias18.go
go/gcimporter15/isAlias19.go
go/gcimporter15/testdata/a.go
go/gcimporter15/testdata/b.go
go/gcimporter15/testdata/exports.go
go/gcimporter15/testdata/issue15920.go
go/gcimporter15/testdata/issue20046.go
go/gcimporter15/testdata/p.go
go/gcimporter15/testdata/versions/test.go
go/gcimporter15/testdata/versions/test_go1.7_0.a
go/gcimporter15/testdata/versions/test_go1.7_1.a
go/internal/gccgoimporter/gccgoinstallation_test.go
go/internal/gccgoimporter/importer_test.go
go/internal/gccgoimporter/parser.go
go/loader/loader_test.go
go/ssa/interp/external.go
go/ssa/ssa.go
go/vcs/vcs.go
go/vcs/vcs_test.go
godoc/cmdline.go
godoc/cmdline_test.go
godoc/dirtrees.go
godoc/dl/dl.go
godoc/godoc.go
godoc/index.go
godoc/pres.go
godoc/server.go
godoc/spec.go
godoc/static/gen.go
godoc/static/godoc.html
godoc/static/godocs.js
godoc/static/makestatic.go
godoc/static/package.html
godoc/static/playground.js
godoc/static/static.go
godoc/static/style.css
godoc/template.go
godoc/vfs/emptyvfs.go
godoc/vfs/gatefs/gatefs.go
godoc/vfs/mapfs/mapfs.go
godoc/vfs/namespace.go
godoc/vfs/os.go
godoc/vfs/vfs.go
godoc/vfs/zipfs/zipfs.go
imports/fastwalk.go
imports/fastwalk_dirent_fileno.go
imports/fastwalk_dirent_ino.go
imports/fastwalk_portable.go
imports/fastwalk_test.go
imports/fastwalk_unix.go
imports/fix.go
imports/fix_test.go
imports/imports.go
imports/sortimports.go
present/parse.go
refactor/eg/eg.go
refactor/eg/eg_test.go
refactor/eg/rewrite.go
refactor/eg/testdata/no_after_return.template
refactor/rename/rename.go
Please commit your changes or stash them before you merge.
Aborting
Updating 73e16cff..d74aaa1f
package golang.org/x/tools/cmd/stringer: exit status 1
make: *** [devtools] Error 1
Hoping that this wasnt too serious, I tries creating my go file with the following line:
abigen -abi=Store.abi --pkg=store --out=Store.go
bash: abigen: command not found
I suspect this has to do with my failed install and will appreciate any pointers on this
I was able to solve this by doing the following:
cd /Users/pro/go/src/golang.org/x/tools (This is the repo that had the issues)
Run git stash save && git merge origin/master && git stash pop
Run make devtools (The make file contains the instructions for installing abigen and placing it in usr/bin
I got help from this answer:
How do I ignore an error on 'git pull' about my local changes would be overwritten by merge?

error: git-credential-osxkeychain died of signal 11 - can't understand answers

I am trying to push a text file to github and am getting the above error. I am using OSX 10.7.5 and git-1.8.4.2.
I have created a text file which I seem to be able to add and commit without problems. On my first attempt, I had the following error message:
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
error: `git-credential-osxkeychain died of signal 11`
Username for `'https://github.com'`: Anto58
Password for `'https://Anto58#github.com'`:
error: `git-credential-osxkeychain` died of signal 11
To `https://github.com/Anto58/datasciencecoursera.git`
! [rejected] master -> master (fetch first)
error: failed to push some refs to `'https://github.com/Anto58/datasciencecoursera.git'`
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I spent some time researching this and found that this was a problem because my github repo had a readme file in it that was not on my local repo and I tried implementing both suggested solutions, cloning and pulling before pushing.
The cloning looked as though it was working:
Cloning into 'coursera-repo'...
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
Checking connectivity... done
But I still couldn't push. So then I deleted my directory and started again using pull, which gave virtually identical output:
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From `https://github.com/Anto58/datasciencecoursera`
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
But same problem with pushing:
error: `git-credential-osxkeychain` died of signal 11
Username for `'https://github.com'`: Anto58
Password for `'https://Anto58#github.com'`:
error: `git-credential-osxkeychain` died of signal 11
Everything up-to-date
While it said everything was up-to-date, the file did not appear in my github'repo`.
Then I found the link on the stackoverflow question which had the link to the site dealing with caching your github password, which I tried to follow.
I typed
git credential-osxkeychain
which gave me the same error as I started with
I then tried to download the osxkeychain helper using the curl command:
`curl -s -O \
? https://github-media-downloads.s3.amazonaws.com/osx/git-dredential-osxkeychain`
I didn't get an error message for this, so I'm assuming it worked?
The next step was changing the permissions:
chmod u+x git-credential-osxkeychain
which again didn't give an error message
But I fell over at the next step:
sudo mv git-credential-osxkeychain \
"$(dirname $(which git))/git-credential-osxkeychain"`
where I got an illegal variable name message. Is this because dirname should actually be /user/local/git/? And should "which git" also be replaced by something else? I started getting pretty nervous at the point when I got the message:
`WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.`
because I really had no idea what I was doing.
The TA on Coursera suggested just running
git config --global credential.helper osxkeychain
but now I get the error message twice instead of just once and still can't push.
I have also tried to find where my gitconfig file is since one of the suggestions is to delete your gitconfig file but only after checking it doesn't have anything else in it. It didn't show up on a normal search in finder so I assumed it is hidden and used defaults write com.apple.finder AppleShowAllFiles YES but without success. When I use alt Relaunch, Finder keeps opening with the Git package window that doesn't have a search option.
Sorry this is so long - Can anybody help me and explain what I need to do in very simple terms - assume I know nothing?
Also if you can explain why that would be incredibly helpful as I would like to understand how it works.
I am using the same Mac operating system and Git version as you and have been getting the same error messages when trying to push the HelloWorld.md file to my datasciencecoursera repo on Github. I finally got round this by deleting the repo on Github and making it again but without ticking the create README file, so its just a completely empty repository. I then deleted and recreated the directory I'd made on my local computer, remade the HelloWorld file and followed the course instructions again for initiating and linking the local/Github repositories and pushing the file to GitHub. The final command that worked for me was one the options suggested by GitHub when I set up the repo: git push -u origin master (after linking to the local repository). I still got the error messages, and got asked for my user name and password. I entered these (note that the password does not show up when you type it in...) and then got the error messages again but followed by detail:
error: git-credential-osxkeychain died of signal 11
error: git-credential-osxkeychain died of signal 11
Counting objects: 3, done.
Writing objects: 100% (3/3), 244 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/keh444/datasciencecoursera.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
When I looked on GitHub the HelloWorld file was in the repo, so it had worked.
While this may not have solved the problem in the long term at least I can now move on...

GitHub for Mac crashes on open because of local repository issue

I am trying to figure out why my GitHub for Mac crashes on start when I choose a local repository. I added this local repository from a folder I had cloned. Unfortunately, I was playing around with the git command line and I must have done something to corrupt the local repository.
Now my GitHub for Mac is trying to access this corrupted repository on reopen and I can't change it within the program before it crashes. I would rather not purge the system of files because I have other repositories saved in GitHub for Mac.
How exactly would I be able to solve this issue or delete the reference to this local repository that is causing me massive issues? I have attempted to get an answer from the people at GitHub but they have not responded to me yet. Thank you. The error I am getting is below.
*** Terminating app due to uncaught exception
NSInternalInconsistencyException', reason: 'Received error from <RACDynamicSignal: 0x600000e3dca0> name: in binding for key path` "headerContentViewModel" on <GHChangesViewModel: 0x600000129420>:
NSError { domain: GTGitErrorDomain, code: -12, description: "Failed to create reference to tracking branch from <GTBranch: 0x600000e20c00> name: refs/heads/master, shortName: master, sha:
b5db93cacaf51cde5ad27c605c4bdb114cd23605, remoteName: (null), repository: <GTRepository: 0x60000041b4e0> fileURL: file:///Users/name/Desktop/personalWebsite/", underlying error: NSError { domain:
GTGitErrorDomain, code: -12, description: "'https://github.com/name/git.git' is not a valid remote name." } }'
terminating with uncaught exception of type NSExceptionabort() called
I had this same problem, the source turned out to be an incorrect line in my .git/config file.
The master branch had these lines:
[branch "master"]
remote = git#github.com:/.git
which matched most of the url value for the [remote "origin"] line.
Changing the line to this:
remote = origin
Fixed the problem immediately, and no more "Unable to create tracking branch" errors like I've had for quite some time.
Be sure to make a copy of that line in case it doesn't work.
GitHub support verified that this was the correct solution - at least in my case.
It looks like you've changed the config file, specifically for the repo location. If you're not able to repair the git config file yourself, can you do cat ./.git/config for us?

After porting some php and web app related files from my friend's windows computer to my mac I'm getting some errors

This is for a facebook app being run on heroku, but heroku is probably not the issue. The issue is either some kind of cache related thing, os porting, or I'm thinking it might be a carriage return issue.
In any case I'm getting a couple errors at the top and bottom respectively:
Warning: Unknown:
Warning: session_start(): open(C:\ProgramData\Jcx.Software\VS.Php\2.10.6970.0\temp/sess_i4ood4poc11ebsgth000g1nm74, O_RDWR) failed: No such file or directory (2) in /app/www/sdk/src/facebook.php on line 37
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /app/www/sdk/src/facebook.php:37) in /app/www/sdk/src/facebook.php on line 37
open(C:\ProgramData\Jcx.Software\VS.Php\2.10.6970.0\temp/sess_i4ood4poc11ebsgth000g1nm74, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\ProgramData\Jcx.Software\VS.Php\2.10.6970.0\temp) in Unknown on line 0
Essentially I have tried the whole "making sure session is at the top thing," but I don't have that session piece of code in any of the files. I have tried the whole making sure "?>" is on a new line as well to no effect.
update
I have discovered something called:
zend_extension_ts="C:\Program Files (x86)\Jcx.Software\VS.Php\2010\php 5.2\ext\php_xdebug.dll"
within a file called php.ini which even after I tried to get rid of didn't seem to change anything. So, I'm thinking this has something to do with some previous files that I pushed and then removed with extensions like puo, intellisense.cache, projphp, etc.
I don't know if those are auto-generated or not, but in any case according to my errors:
There is some session data in a file called temp. I have no file named temp.
zend_extension_ts supposedly gets referenced somewhere, but it isn't visible in my code.
I apparently need to resend session cache limiter again through session_start() which is not visible in my code.
Is not the session , I'm sure. But there is directory path included in your code but that directory does not exist! Just refactor that part of the code first!
As a tip you should use realpath() and check if path exist before attempting to use it.
Hope this helps!

Resources