Git Bash -Segmentation Fault Problem (Windows) - windows

Indeed I have same issue which is mentioned here "Why does bash (from git installation) give me segmentation fault suddenly?
"
My git was working properly. But I need to regenerate keygen value and I got segmentation fault. I remoted git and installed the latest version of git (2.19.0-64-bit). I tried with git-bash from search, bash.exe from bin folder , git.exe from bin folder , git-bash.exe under Git Folder and git-cmd.exe under Git folder. The results are same.
After I read the link I shared above , I checked the windows updates as well. But there is no update.
Is there any idea ? Thanks in advance

2.9 is not the latest, one: 2.19 is.
Try (for testing) and uncompress the latest Git for Windows portable archive PortableGit-2.19.0-64-bit.7z.exe anywhere you want.
Then setup a simplified path in a CMD session.
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
set GIT_HOME=C:\Path\to\Git
set PATH=%GIT_HOME%;%GIT_HOME%\bin;%GIT_HOME%\usr\bin;%GIT_HOME%\mingw64\bin;%PATH%
(Add any other path you would need)
Try then to regenerate your SSH key.
Also, make sure this is not related to an AV (Anti-Virus) as in issue 1832 or issue 1291.
My company also uses TrendMicro.
Can confirm that making an exception for /Git/usr/bin/bash.exe works as well.
For me it was C:\Program Files\Git\usr\bin, but adding it to the list of trusted programs did indeed fix the issue

I faced the same problem yesterday. Using git-bash, all my commands (i.e. mvn, javac, git pull) were giving error "Segmentation fault". This was because an update of my machine anti-virus which blocks proper access to my local login profile (sambit-swain#TERMINAL) After un-installing it, everything went back to normal.
So, the problem is not with GIT BASH or any other configuration. I should have checked the access levels (including SSH keys) to programs.

Related

GIT Issue on Windows (The filename or extension is too long)

Overview:
Just installed the GIT version 2.20.1-64-bit on my Windows 7 platform. Git works well on GIT Bash; but, any git command on Windows CMD or Powershell raises The filename or extension is too long error.
Details:
GIT version: 2.20.1-64-bit
Platform: Windows 7
Troubleshooting Efforts:
I tried switching longpaths attribute to true based on Filename too long in Git for Windows. I also googled to find other solutions but all recommended the same approach which was updating the git config.
The GIT config file updated with git config --system core.longpaths true
Issue:
Any Git command via Windows CMD or 3rd party apps like IntelliJ Idea raises the following error:
CMD:
IntelliJ:
Please advise me with your genuine solutions.
I had the same problem. I then installed it in my user folder and now it works. It seems to be a privilege issue. Git gets installed as admin in C:\Program Files\Git but then can't write to these files because it is run as a user.
Also using the portable version should fix the problem.
Try first to use a simplified PATH and a portable Git (like PortableGit-2.20.1-64-bit.7z.exe) uncompressed anywhere you want.
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%
Then check if the issue persists in that CMD session, where you have set said simplified PATH.

Git Extensions "function not implemented"

I'm trying to use Git Extensions on a new Windows 7 machine. I have done that many times before but never hit this particular issue.
Git Bash is working, I successfully cloned a repository.
But going to Git Extensions, opening the repo, and doing a pull gives me the following error message:
"C:\Program Files (x86)\Git\bin\git.exe" pull --progress "origin"
error: cannot spawn git: Function not implemented
Done
Press Enter or Esc to close console...
My setup is very ordinary. The Git Extensions startup checks all pass. (This is similar but not the same problem as the common invalid path issue.)
Do you have any idea what causes this problem?
The new releases, Git for Windows 2.16.1(3) and Git for Windows 2.16.1(4), fix this regression:
2.16.1(3) Bug Fixes
When http.sslBackend is not configured (e.g. in portable Git or MinGit), fetch/push operations no longer crash.
On Windows 7 and older, Git for Windows v2.16.1(2) was no longer able to spawn any processes (e.g. during fetch/clone). This regression has been fixed.
The Perl upgrade in v2.16.1(2) broke git send-email; This has been fixed by updating the Net-SSLeay Perl module.
The mentioned regression in the second bullet point is exactly the error this question is about.
Unfortunately, there was one missing issue about spawning processes which was then fixed in the subsequent fourth release:
2.16.1(4) Bug Fixes
When called from TortoiseGit, git.exe can now spawn processes again.
Note that the download on https://git-scm.com/download/win might not have been update yet, so you need to download it from gitforwindows.org or directly from the release page on GitHub.
Afterwards, you can verify that you indeed running the new version using git --version which should report git version 2.16.1.windows.4.
Per Philippe and Jake - bug is filed against GIT 2.16.2, and workaround is to go back to prior version.
https://github.com/git-for-windows/git/releases/tag/v2.16.1.windows.1
Running an update on my machine to Git for Windows v2.21.0- just a slightly updated version fixed the issue with my Windows 7 installation at work.
https://github.com/git-for-windows/git/releases/download/v2.21.0.windows.1/Git-2.21.0-32-bit.exe

Does VSCode come with git itself?

The documentation says plain as day that VSCode does not come with git, that it leverages your machine's git installation and you must install it.
HOWEVER, it worked just fine for me. I only had github desktop and I am absolutely positively sure that I did not have git for windows installed and github desktop did not place itself in my PATH. (Technically I did have git on Bash on WSL but I know vscode isn't/can't access that). And yet it worked just fine for the longest time.
So, my question is, did vscode come with its own git executable? I ask because ever since I set up 2 factor auth on my github account I've been having to manually log in each time I push, it doesn't use my SSH keys stored in username/.ssh like git shell does.
Github Desktop installs git for you, typically located "C:\Program Files\Git", which is what VSCode, in your case, is most likely using.
If you refer to the answer from this post:
VSCode Terminal + Git Bash "command not found" for any command
it shows the settings (settings.json) that you need to add to allow for git bash and login to be used.
Hopefully this helps!

msysgit error with hooks: "git error: cannot spawn .git/hooks/post-commit: No such file or directory"

I'm having trouble getting post-recieve and post-commit hooks to work correctly with msysgit (Windows 7 Pro/32 and Ultimate/64). For post-commit hook I get the above error if I commit from either git-bash or the console, but it works fine if I commit through git-gui. For a post-recieve hook, all three give the same error.
I'm thinking this is some sort of permission or path error, but don't really have any clue where to start here.
Add the SHEBANG to the first line of hook, like so:
#!/bin/sh
echo "executing post-commit"
exit 0
This had me stumped for a while as well and I saw that adding the shebang fixed it. In SVN world, while in *nix we have a "pre-commit" script and in Windows we had "pre-commit.bat" and SVN automatically picked up the bat file in Windows. Git doesn't seem to pick up a pre-commit.bat ( or any hook ) and adding the shebang to the hook file worked.
I'm using SourceTree and git LFS and had a similar issue: cannot spawn .git/hooks/pre-push.
The fix was to delete the pre-push file (opening it revealed it was badly corrupted) and restart SourceTree at which point it regenerates the pre-push file and everything is back to normal.
If you have the SHEBANG and it still fails, make sure you have <path_to_git>\bin set in your path environment variable.
You'll probably also have <path_to_git>\cmd if you installed it to work from the command-line.
This is an old question, but I've been fighting with this exact problem and this SO question popped up, so I thought it worth the effort to record what worked for me.
In short: I needed to run Apache as a regular user instead of Local System. This was on a legacy test VM I was playing with, so it was only running Windows XP, but it appears that at least on that platform (and possibly others), msysgit just doesn't work properly when running under the Local System account (presumably the root filesystem isn't mapped properly). As a result, no shebang line will work as git-http-backend simply can't execute any msysgit binaries (even with absolute Windows paths).
Switching Apache to run as a regular user account fixed this problem completely. Obviously you need to ensure that the user Apache is running as has permissions to read/write the git repositories, but beyond that, just make sure your shebang line is #!/bin/sh and everything should be copacetic.
Lastly, yeah, this is a big hammer. Ideally you'd be able to use something like suexec on Windows, but a quick googling doesn't indicate an obvious path forward, there. Of course, if anyone has any ideas, I'd be interested.
For now, this works for me, but it doesn't seem ideal.
Got this in a repo using LFS, got rid of it with git lfs update --force
If someone, like me run into a similar problem with accessing git repositories through apache, you should set the PATH in Apache config, like:
SetEnv PATH "c:/Program Files (x86)/Git/bin;"
Using tortoisegit and LFS, for me just had to remove the files inside of the .git/hooks folder.
If you are using Android studio, you can remove this error by un-check the checkbox "Run Git hooks":
For me, removing a comment line on front of the shebang line fixed the error. Oddly, the script ran fine from the shell, just errored out when run as a hook.

Git fatal: remote end hung up

So I thought I had finally got everything setup on Windows ... then ran into this issue.
Current setup
URL: ssh://user#host:port/myapp.git
Already run Putty - and can connect using valid .ppk keys through the ~/.ssh/authorized_keys direct. In Git and TortoiseGIT - I set both to use "plink.exe".
Putty works fine - no issues - but when I run that URL into bash I get for a git clone (url)
fatal: the remote end hung up expectedly
In a cygwin bash terminal - running "ssh user#host" - works no probs at all.
Anyone suggest anything?
I found out that using ssh.exe from the Git package works every time, as opposed to the ssh that comes with cygwin (the default).
Using this exported variable seems to help; it's slower (2x or more) but it's more stable. Take it as another workaround.
$ export GIT_SSH=/cygdrive/c/Program\ Files/Git/bin/ssh.exe
FYI:
This version of Msysgit comes with OpenSSH 4.6p1, OpenSSL 0.9.8e. [works]
Cygwin's SSH is OpenSSH 5.5p1, OpenSSL 0.9.8n. [doesn't work]
I had the same problem with plink for git under windows.
On run of plink.exe -v xxx#host.com it started to show
Pageant is running. Requesting keys.
Pageant has 1 SSH-2 keys
login as: <<< trouble
Instead of
Pageant is running. Requesting keys.
Pageant has 1 SSH-2 keys
Using user "xxx"
To resolve this problem I cleaned up the putty registry records and sessions by
putty.exe -cleanup
After that plink starts afresh and asks to trust and store the host again and it is getting connected with no problem !
Try following steps, maybe something will give you a hint on your problem:
1. Run putty and after setting up server name/user name/keys etc. save those settings.
2. Run plink.exe or plinkw.exe like plink.exe user_name#server, (it'll throw some info at you) just to see if plink can connect to the server.
3. Check again that git knows that it should use plink, I'd say with all VCSs, that's the problem people have most often, apart from their keys not being set up properly.
Normally by now most of your ssh problems would be revealed. Now just fix them. :)
Update:
I think the problem you have is caused by several gits you've got installed. For the msysgit and cygwin git you'd need to set the GIT_SSH variable. That's done via either 'set GIT_SSH=c:\path\putty\plink.exe' or 'export GIT_SSH=/your/path/putty/putty.exe' respectively. If you're also using tortoise git, you'd need to locate 'properties' (or is it settings?) in it's menu, and set the ssh client there.
Apart from all that, when specifying git clone URL, use your login name and the server name in there, e.g. 'git clone ssh://user#server/your/path/repo.git User and server names should be used by plink, and plink should be able to connect to the server with those arguments, when all of those requirements are met, you'll be all set.
Good luck.
If you want to try the cygwin openssh 5.4p1-1, which does seem to work for this, unlike 5.5 or 5.6, you can use the cygwin time machine mirrors. Start setup.exe with -X and add a mirror Url, such as:
ftp://www.fruitbat.org/pub/cygwin/circa/2010/05/20/230133
Be careful not to install too much, i.e. base packages, from an older mirror than the rest of your install.
We had same problem and here is solution how we solved the problem:
at first we got:
zajdan#cyberFuture:~$ git clone ssh://nette#19X.16X.14X.7X/~repos/erotika.git/ erotika
Initialized empty Git repository in /home/zajdan/erotika/.git/
Password:
fatal: '/repos/erotika.git': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
zajdan#cyberFuture:~$
solution:
zajdan#cyberFuture:~$ git clone ssh://nette#19X.16X.14X.7X/~/repos/erotika.git/ erotika
after tilde there must be a slash!
I have exactly the same issue.
I don't use Putty (just Cygwin).
I use Windows 7 Ultimate (fully patched as of this moment).
I just installed Cygwin yesterday.
I made sure binary mounts were being used.
If I copy a git repo to the machine (via samba mount), I can clone it, but when I "git diff" after the clone, there are a bunch of "different" files with no diffs. After a "git status" there was no output from "git diff". It seems like a newline thing, but I can't figure out how that would be happening. (I have igncr in SHELLOPTS, but removing that doesn't fix it.)
I'm completely stumped.
Check the openssh version you're using in CygWin. Version 5.5p1-1 (which is the latest at this time) gave me the same error. Downgrading to 5.4p1-1 fixed the problem.
Another solution would be to use putty/plink instead of openssh.
For more details, see this thread: http://www.mail-archive.com/cygwin#cygwin.com/msg103752.html
I get message: "remote end gung-up, unexpected EOFs, index-pack failed" while cloning git repo but was able to workaround this issue with copssh http://sourceforge.net/projects/sereds/files/Copssh
The root cause is Cygwin openssh package.
I removed original openssh from Cygwin, installed copssh and set GIT_SSH variable to point copssh binaries. After this I simply added copssh binaries in the PATH and now I'm using copssh instead of openssh - there is no difference.
Everything works fine and issue does not appear any more.
The other solution is to use mSysGit package.
I believe the real problem is that cygwin's ssh looks for .ssh in /home/name/.ssh and mingw's git ssh looks for .ssh in c:/user/name/.ssh
Chances are your keys are in one and only one of these directories.
You can trying telling cygwin's .ssh to use a different identity file using the -i switch, or move the keys into both directories, or create an ssh config file in /home/name/.ssh/config.
I created a config that contains:
Host github.com
User jerryasher
Hostname github.com
IdentityFile c:/Users/jerry/.ssh/id_rsa
And given that I can use either the mingw git from git bash or cygwin's git from an rxvt to interact with github.
To correct this issue, run "plink -agent github.com"
Press y when prompted to cache the key. Login as git. You'll automatically be disconnected. And it sould work.
Source: http://devlicio.us/blogs/sergio_pereira/archive/2009/05/06/git-ssh-putty-github-unfuddle-the-kitchen-sink.aspx
Try to use absolute path to repo in a URL, that worked for me.
Instead of:
git ssh://user#host:port/myapp.git
Write:
git ssh://user#host:port//home/user/repo/myapp.git
Notice the double slash!

Resources