Git - Protocol Error - Strange character - windows

I have failed at google, please help.
I have a base Windows 8 OS running Vagrant with Ubuntu 14 (32bit).
When running
git add -A
or
git add *
I get the following message:
addressesâ–’show.blade.php: Protocol error
I am developing on Windows but gitting through Vagrant.
I can commit and push, but I am sure something is wrong and would like to resolve it before it really causes a problem later.

It looks like there is a strange character between 'addresses' and 'show.blade.php' which may be causing problems in the content of the added tree. You can run git fsck to see if the state of the .git repository has been corrupted. Alternatively you may have redefined add as an alias to do something like 'add-and-push'?

Related

Windows - Git: staging fails ==> Invalid argument

I have a file called "adm.php".
I want to transfer this to my repository, but I always get the following error message:
git
-c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks add -f --
adm.php
error: open("adm.php"): Invalid argument
error: unable to index file 'adm.php'
fatal: adding files failed
Completed with errors, see above.
I'm using Sourcetree on Windows 11.
Renaming the file would be difficult, otherwise I would have to adapt some files...
Is there a possibility to define exceptions in the Git configuration or other possibilities?
Thanks in advance!
For everyone who should have the problem and don't know what to do next:
Windows Defender and other anti-virus programs may even mistake certain files for a virus. In my case, this wonderful operating system didn't even notify me even though I activated it ...
Sometimes the solution can be so simple ... Create an exception and now everything works for me.

Unable to use git in WSL. C:\Windows\System32\OpenSSH\ssh.exe: not found

So im on Windows 10 and a while ago i decided to use WSL so the I can get zsh. However, now I can no long use git from my wsl terminal, i.e I can no longer git pull from remote repo. When I try I get the following...
'C:\Windows\System32\OpenSSH\ssh.exe': 1: C:\Windows\System32\OpenSSH\ssh.exe: not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Such operations work fine in bash and from GitHub Desktop. Why is WSL trying to use OpenSSH from Windows it should be Linux right?
Im struggling to find information on this problem so any help is greatly appreciated. Let me know if there is more information I can provide.
I got the same error after changing the value "core.sshCommand" like this:
git config --global core.sshCommand "'C:\Windows\System32\OpenSSH\ssh.exe'"
In my file ~/.gitconfig, I disabled newlines like below :
#[core]
# sshCommand = 'C:\\Windows\\System32\\OpenSSH\\ssh.exe'
Then when you are in a git repository, if you have the same problem check your my-project/.git/config file and if there is the new config disable it as above.
In my case it worked :-)
Have a nice day
Double check if you have an environment variable GIT_SSH which would point to C:\Windows\System32\OpenSSH\ssh.exe: that would not be a valid path in a WSL session.
Unset it.
After that, it depends on the Windows 10 used ( 1709? 1809? 20H1? ...), and on the WSL used (WSL1 or WSL2?).

Git installation failed [duplicate]

I am new here and i will try to explain my question kindly ignore any mistakes.
I am using git version git-2.8.2
It worked fine for one day then this problem occurs.
I am using gcloud repository.
First I tried gcloud clone command then this error occurs
Then to make sure git is there I tired git command then this error occurs
Then I double check by opening git Bash but same error was there too.
I tried reinstalling changing directory. but nothing works.
I face the same problem after I try to avoid memory leak in Windows 10. If you happened to change the regedit like me, just type regedit in the search then go to
HKEY_LOCAL_MACHINE -> SYSTEM -> ControlSet001 -> Services -> Null
change the value of Start to 1.
I accidentally bumped into the same problem when I was sorting out the services running on my computer with Windows 10.
fatal: open /dev/null or dup failed: No such file or directory
The reason was that I deleted the service named 'Null' that had no description as I thought that was a virus service.
Thus, when I found my git unable to operate, I reckoned the deleted service.
According to a solution provided on some site I tried to run the service again using cmd.exe
sc config Null start= system
sc start Null
but it said the service hadn't been existed in the list.
Thankfully, there are some kind folks who shares the information of the default services running on Windows 10 and the description necessary for the successful bringing back the service.
So as to get the service back in the list:
press Win + R
type regedit
go to HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services section
Create Null folder and all the params it needs.
Restart your computer.
Now you got your Null service back and your git back as well.
Hope this helps.
I solved my problem accidentally. I would like to share it with everyone.
It was not a problem of git or gcloud or source tree.
Actually I have forcefully stooped windows update from installing which causes this problem.
Now when I install windows updates again this problem is fixed now.
Maybe this helps someone.
the similar situation in chrooted linux tree is fixable following way:
cd inside the folder where you are preparing the chroot dir, then
mount -o bind /dev dev/
then only chroot inside
I had this weird bug just now. I went back a dir and tried git init, it worked there.
I re-ran zsh and tried again in the dir it errored in originally and it worked. shrugs

bitbucket ssh error setsockopt IPV6_TCLASS 8 Operation

I'm having issues connecting to a Bitbucket repository using SSH. I have the public and private keys set up correctly. I'm worried that the issue is due to the fact that I"m working on a Windows 10 machine. Does anyone know how to get around the following error:
*setsockopt IPV6_TCLASS 8: Operation not permitted:
repository access denied. deployment key is not associated with the requested repository.
fatal: Could not read from remote repository .
Please make sure you have the correct access rights and the repository exists.*
I know I am in the repository. I can check out different branches in the repository and commands such as "git add" and "git commit" appear to work, however, "git push" is failing due to the above mentioned error.
Thank you
Make sure to use the latest Git for Windows (2.19.1) and, as I mentioned here, try a git push -4 ...
That will force the use of IPV4, to check if that would work better.
As detailed in this thread:
For me it's an IPv6 issue.
BitBucket doesn't respond to IPv6 ssh requests, so you have to wait for it to timeout.
I fixed it by adding:
AddressFamily inet
to /etc/ssh/ssh_config and git pull responds within seconds not minutes.
The last part is only valid if you are using an SSH URL, and for git pull, but might still have an effect for git push.
As noted by xpt in the comments, WSL issue 1869 says it OK to put AddressFamily inet into ~/.ssh/config, but I've just tried it, and it was not working for me, until I put it into /etc/ssh/ssh_config instead.
Thank you everyone for your help. There were two issues causing this.
First, the IPV6 warning itself was resolved once I upgraded from git version 2.7.4 to 2.19.1.
After making this adjustment I still saw an error "Permission denied (publickey)..."
I resolved this error by moving the private key, id_rsa, to the following location:
/c/Users//.ssh/
Everything seems to be in order now.

Git not working with remote server

I have git installed and working as expected on my local system or a network share, but have not been able to get it to access the remote bare repository on my server using ssh.
I have installed msysgit and CopSSH on the server and msysgit, putty and tortoisegit on my local system. I am able to open a putty session or use plink successfully -- at least I believe plink is successful, but more on that in a bit.
When I attempt to clone a remote repository I get this:
D:\Temp> git clone uname#server:e:/path/test.git Test
Cloning into Test...
fatal: protocol error: bad line length character: Micr
The error message has been consistent for a while, but at times (from one reinstall attempt to another) the last four characters will be 'Micr', 'Allo' or something else I don't remember right now. In the currently installed state it is 'Micr'.
So the big question is what am I not doing right?
Although I imagine it would be much easier to correct what was wrong if I could get the actual error message instead of the generic one followed by the first four characters of the actual error message. Any idea if that is possible?
First, you have variables like export GIT_TRACE=1 and export GIT_TRACE_PACKET=1 which can help debugging this kind of situation.
Second, this error is often caused by any kind of display done during the ssh session (see for instance this thread), like a .bashrc on the server side with an echo in it.
I have a wrapper set-up around ssh that sets the window title of the shell to the ssh command argument. That is what messes things up!
See also Git FAQ
Other causes include:
using the right ssh
correctly forcing to use git-shell
using --exec-path from the server_arg on the server side
Note: with Git 2.6+ (Q3 2015), see also "GIT_TRACE_PACKFILE".

Resources