Git over SSH Server in Windows, cannot find shared libraries - windows

I was to setup an SSH Server to Host my Git Repository to my local area network. I followed this tutorial by TimDavis hoping that I would be able to make a secured Git Repository.
I tested my connection using Putty and it was successful. My only problem was I cannot run "git" command in the console. Then I tried cloning my repository, and this was the error that outputed:
/usr/bin/git-upload-pack.exe: error while loading shared libraries:
libiconv2.dll: cannot open shared object file:
No such file or directory
Also when I ran "git" command in the Putty Bash that was connected to the SSH Server, this was the error I encountered:
/usr/bin/git.exe: error while loading shared libraries: pthreadGC2.dll:
cannot open shared object file: No such file or directory
I seems that all my problem was about the missing libraries but I don't know how to solve it. I am using Windows 7 as an Operating System.
Thanks

As explained here: http://christopherpeplin.com/2013/01/cygwin-git-https/ the sasl libraries and the ca-certificates are missing. Install them by running the setup of cygwin, and installing libsasl2 and ca-certificates packages (the first is support for SSL and the second the root certificates that will be used for SSL authentication).

I got this error too. I tried copying not just git.exe but the corresponding dlls (libiconv, etc...) from the git bin directory to the CopSsh bin directory and it went away.

Hi if you are talking about the following article:
http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/
Then try to modify the path. Just add add the following lines into \home\.bashrc :
export PATH=$PATH:/cygdrive/d/programs/Git/bin:/cygdrive/d/programs/Git/libexec/git-core
Where d/programs/Git is a d:\programs\Git -- is a path to msysgit installation

I also found that git submodule update would fail on Cygwin due to another broken dependency, where you need to install the gettext package as well.
http://cygwin.1069669.n5.nabble.com/Re-shared-object-file-not-found-with-git-submodule-update-init-recursive-in-Cygwin-64-bit-td104123.html

Related

Git Bash -Segmentation Fault Problem (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.

Error with git pull and git push [duplicate]

I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
fatal: unable to access 'https://github.com/snahrvar/eatibl.git/':
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert
protocol version
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
Git version: 1.9.4.msysgit.2
Windows version: Windows 8.1
Updating TortoiseGit and GCM didn't help me, but updating Git itself did, as per #Frederic's advice in comments.
https://git-scm.com/download/win
To make sure the new version of Git installs properly and doesn't conflict with previous installations (it might, if you used TortoiseGit's, because it would use different folders and mess with PATH variable), remove the existing Git installation before installing the updated Git. Might also need to install with administrator rights.
You're likely running into an incompatibility with GitHub's deprecation of weak SSL encryption protocols:
Weak cryptographic standards removal notice
The solution will vary, but for Windows you likely need to upgrade the Git credential manager to 1.14.0
https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0
If you are using Android Studio or IntelliJ IDEA, updating Git to the latest version and changing the path to point to the new version solve the problem for me.
Using TortoiseGit, I did all of the other fixes/updates given for this and still no success. I found this: Can't git push/pull/fetch suddenly
My TortoiseGit settings for Git for Windows Git.exe path was pointing to C:\Program Files (x86)\Git\bin. I changed it to C:\Program Files\Git\bin and now it's working again.
This is what worked for me.
Install the latest version of Git from here: https://git-scm.com/download/win
In TortoiseGit, go to menu Settings → General → Git.exe Path - change it from 32-bit to 64-bit path:
C:\Program Files (x86)\Git\bin → C:\Program Files\Git\bin
Updating Git was not enough in my situation. After debugging for several hours, this was my fix:
C:\wamp64\www\maandlastenmanager> git config http.sslVersion
tslv1.0
C:\wamp64\www\maandlastenmanager> git config http.sslVersion tlsv1.2
C:\wamp64\www\maandlastenmanager> git config http.sslVersion
tslv1.2
I had this same problem while pulling code from GitHub on my Visual Studio Code terminal. I found the advice in the previous answers useful and hacked a solution together following the steps below:
I updated Git.
I updated Git Credential Manager for Windows.
Made some changes to the registry.
Updated my Visual Studio Code installation to the latest version.
Changed my Windows path for Git from C:\Program Files (x86)\Git\bin. to C:\Program Files\Git\bin.
This repository was quite useful.
I hope this helps someone.
TL;DR: git config --system http.sslbackend schannel and switch off HTTPS checks for github.com in your antivirus software
I'm using the Git command line on Windows 8 x64. In addition, my antivirus software checks HTTPS traffic by default. Like other people in answering this question, I use GitHub almost daily.
Updating Git - didn't help - because I used OpenSSL (see below)
Updating credential manager - didn't help
Then I started playing with switching the SSL backend:
git config --system http.sslbackend openssl
----------------vs------------------
git config --system http.sslbackend schannel
and the antivirus software checks for SSL traffic:
OpenSSL, HTTPS checks ON: error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block type is not 01
OpenSSL, HTTPS checks OFF: SSL certificate problem: unable to get local issuer certificate
SecureChannel, HTTPS checks ON: schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
SecureChannel, HTTPS checks OFF: worked fine
P.S.: Instead of commandline, you can just reinstall the latest Git, selecting "Use native Windows SSL validation library".
P.P.S.: The case (3) seems to be a bug in the schannel library, because the MITM certificate my antivirus software uses is whitelisted on my machine.
On macOS, you can install the latest git via Homebrew.
Same for me with Git 1.9.5.msysgit.1 too. I tried to install https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0, but no change.
Actually, nothing happen after installation; maybe I'm doing something wrong? (That may not help for the initial question, but for other people, yes!)
Yeah, I encountered the same issue on a pull request today and the solution was to simply update Git by downloading the latest (2.16.2) 64-bit version of Git for Windows. It was released 5 days ago, on 2018-02-20.
The comment by #andw worked for me:
Update Git version 1.9.5 to 2.15.1 using these steps:
In sourceTree, go to menu Tools → Options → Git → Use Embedded Git.
A quick solution would be git config --global http.sslVerify true, but it is not recommended as it defeats the purpose using SSL.
A second and better way is to use ssh keys rather than an SSL URL.
Steps to generate SSH keys
o Run the following command in a Git terminal (Git Bash): ssh-keygen
After running the command, the following message will appear:
Generating public/private RSA key pair.
Enter file in which to save the key (/h//.ssh/id_rsa):
Give the path for the key to be stored in, for example, enter the file in which to save the key (/h//.ssh/id_rsa): C:\Users\Public\my-new-ssh-key
Then give the passphrase for that key (any password of minimum 8 characters)
• Next run the following command: eval “$(ssh-agent –s)”
• Run the following command: ssh-add C:/Users/Public/my-new-ssh-key Note: use forward slash in the path to the newly created SSH key.
After that, add the contents of the file my-new-ssh-key.pub and add it in the text area for Add public key (Bitbucket, GitHub, etc.)
While connecting to a remote repository to fetch, pull, push, etc., I had the same error:
fatal: unable to access 'https://github.com/repository.git/': error:1
407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
I just reinstalled Git 64-bit in place of 32-bit and that fixed the issue.
After installation, verify the Git path in environment variables. It should be:
C:\Program Files\Git\bin\git.exe
This is an issue with IntelliJ and RubyMine. GitHub must have disabled SSL (PCI compliance maybe?) in favor of TLS. If you open Settings in IntelliJ or RubyMine and navigate to Version Control > Git, you'll see it's using a git.exe installed under the application's path. You should download the most current version of Git and change the path in your VCS settings to point to that, e.g. C:\Program Files\Git\bin\git.exe if you install it on Windows. Works like a charm after that.
Sometimes, this is caused by outdated msysgit which is using old ssl and not maintained any more, you can install latest git for windows, and point the git.exe path in tortoise setting to it, then this problem gone.
Git version upgrade did the trick for me. I had the version 1.9.5 and so and I upgraded to 2.21.0 on windows. Also upgrading is very easy. We don't need to uninstall the older version. Download the latest Git installer and just keep on pressing next using default options and the version will be changed to new version and all the old settings will still be working like ssh keys etc. We don't need to generate the keys again and put on github or any other repository.
Earlier my https protocol cloning was not working and giving error
fatal: unable to access 'https://github.com/tensorflow/models/':
error:1407742E: SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert
protocol version
Once I downloaded new version and ran the same clone command it worked without any issues.
I also came across to this problem recently
What worked for me was to revert an automatic update of git
Encountered a similar error.
On windows, Updated git on windows to the latest version.
That fixed the problem.

I can't find my OSQA install directory in OpenShift via ssh

I have a basic understanding of navigating via SSH. I have installed OSQA following the instructions here:
https://github.com/openshift-quickstart/OSQA-openshift-quickstart
The installation worked, and I can access and modify my OSQA settings via the admin web interface with no problems.
I need to edit the settings_local.py file to disable OpenID (and a few other things), but when I ssh into my app through rhc, I can't find any of the directories I think I'm supposed to be looking for. Here is what I see when I ls:
app-deployments app-root git mysql python
And that's it!
I know I must be doing something wrong, but I've been searching all over, and most instructions start with "navigate to the OSQA installation directory - cd OSQA" -- which seems not to exist! I get the same list of directories when I SFTP in.
Try looking in ~/app-root/repo or ~/app-root/repo/wsgi

Cannot Clone GIT Repository from windows server but can SSH

I have a seen a lot of posts related to the error I am getting but can't find anything that seems like a potential fix I would like to try without getting feedback from some people who know better.
The Setup: I recently built a Windows 7 PC and installed Apache, PHP and MySQL. Everything is working great with my setup and I opened the server up to other devices on the LAN. When I go to a browser and navigate to IPADDRESS:PORT (Installed Apache to listen on a custom port to avoid potential conflicts (Skype, future IIS install?, etc) I get my htdocs index.php page. Great so far.
The last thing I wanted to do was setup Git so that I can do work for my server on my Macbook Pro and push changes to the server. To get this up and running I installed msysgit on my server and was able to create a Git repository for a Media directory I created at the root of my server. When I open this directory up in Explorer I can see the .git directory. The next thing I did was install OpenSSH on the server and I got that up and running. I also changed the default home directory of an SSH connection to the htdocs folder of my Apache server.
Now when I move over to my Macbook pro to test the setup and I am getting problems.
SSH seems to be functioning as expected. When I am on my laptop and run ssh USERNAME#IPADDRESS I get the message to enter my password, I enter my login password and awesome I am in the shell of my server at the htdocs directory.
Git does not seem to be functioning as easily though. I have Git on my Macbook Pro and was able to create a repository in a local directory no problem. When I navigate to a new directory in Terminal that I would like to work with the Media folder project I created on the server and run the following Git commands:
git clone USERNAME#IPADDRESS:/Media
git clone USERNAME#IPADDRESS:\Media
git clone USERNAME#IPADDRESS:/Media.git
git clone USERNAME#IPADDRESS:/Media/.git
etc
(Not sure what exact command I'm supposed to be running. Do I need .git at the end of this command? I see a hidden .git directory in the Media directory but I don't see a Media.git file.)
I get the following error:
Received disconnect from IPADDRESS: 2: fork failed: Resource temporarily unavailable
fatal: The remote end hung up unexpectedly
Based on my searching I can't tell if this error is coming from my client (Macbook Pro) or server. I read that it could be a threading limit set on my Macbook so I entered the following commands and upped my maxprocperuid:
sudo sysctl -a|grep maxprocperuid (which outputted 709)
sudo sysctl -w kern.maxprocperuid=3000 (upped it to ridiculous number to see if it was the problem)
But I am still getting the error when trying to clone the repository.
If you've gotten to the end of this thanks, just trying to provide as much info as possible and any help would really be appreciated.
Thanks.
Try uninstalling OpenSSH and then installing WinSSHD again. Check out this link which suggests the same.
Also, this question might be of some help to you while you are at it.
Git doesn't use ssh by default so you have to specify it when cloning
git clone ssh://[username]#[ip-address]:[port][/path/to/repo]

Trying to get svn2git working on Windows

I'm migrating an SVN repository over to Git. The git-svn command doesn't handle the branches and tags properly but I stumbled across a tool called svn2git which seems to resolve this (https://github.com/nirvdrum/svn2git).
I've tried setting up this tool to work on Windows but I've not had much success.
I started off by copying the svn2git installation to C:\svn2git and downloading Ruby for Windows (http://rubyinstaller.org/) and saved it at C:\Ruby193.
Running svn2git came back with
/bin/env: ruby: No such file or directory
I then copied Ruby's bin and lib folders to svn2git's bin and lib folders respectively.
Running the svn2git then came back with
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) from <internal:gem_prelude>:1:in `<compiled>'
Does anyone know how to get this working on Windows environment? Thanks
Obviously, rubygems.rb is missing. Install it as documented here:
https://rubygems.org/pages/download
Then, install svn2git as instructed here:
https://github.com/nirvdrum/svn2git
After that, everything shall be fine.
I'd suggest you to try SubGit tool. It does translate Subversion tags as tags and works well on Windows (requires Java 5 or newer). SubGit is ready to use. You may get latest build at download page and read documentation on the web site.
Originally in 2012 early SubGit versions required local access to Subversion repository (over file system) but later on (by 2015) on network access to subversion was added.
Disclaimer: I'm SubGit developer.
If all you want to migrate from SVN is the trunk and it's commit history, you can easily do it with the following git commands:
git svn init --prefix=svn/ --no-metadata --trunk=http://[svnHostName]/svn/[projectTrunkUrl] --no-minimize-url
git svn fetch --log-window-size=4000
Tadahhh! You have initialized your local git repository with all your SVN trunk repository history!
Now you probably want to add a default remote and push:
https://help.github.com/en/articles/adding-a-remote
https://help.github.com/en/articles/pushing-to-a-remote

Resources