Git config values clash - windows

I ran into big git configuration problem on my windows laptop. I downloaded Git for Desktop since I wasn't able to install git lfs to my cygwin git. I then removed the git from cygwin. I have a GitHub project which is using git-lfs for storing
large files. When I clone the project and it starts downloading files from the remote server it says:
WARNING: These git config values clash:
git config "http.sslcainfo" = "C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt"
git config "http.sslcainfo" = "/ssl/certs/ca-bundle-ghfw.crt"
Neither of those file locations exist on my computer. When I use git config --list I can see both values for http.sslcainfo. But the mingw one is not listed in with any of the git config --system --list, git config --global --list or git config --local --list. So I can't locate the file where
configuration is. I assume the Git for Desktop wants to use the /ssl/certs/ location since it sets it to git config --system when it is installed. I also have installed mingw on my computer but I couldn't find .gitconfig file inside it. Also I don't know why git would even look from there or where the configurations might be saved. I'm able to clone repository which doesn't use git-lfs. So is there any way to remove the http.sslcainfo = "C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt" configuration? Any help will be highly appreciated.

first of all, i have to tell you that im not sure if i can help you. However, i want to share my information with you.... maybe it helps. I am tying out git-lfs for some big repos at the moment. I am using the bitbucket test server. Atleast on bitbucket, they say that files from git lfs are downloaded via HTTPS and need an ssl cert.
I hope that this helps you a bit. If you got more questions about this, feel free to ask.
Frossy

Related

remote-https is not a git command when cloning repo

On a Windows (version 10) machine, with the latest git client at the time of writing (2.18.0.windows.1), cloning repositories using HTTPS fails with error:
git: 'remote-https' is not a git command.
After a bit of research it turns out that git comes with several remote-<command> utilities, with remote-https being one of them. The error message therefore seems to tell us that `remote-https is not installed on the machine.
After a bit more research, it seems that similar problems for other developers were solved by installing curl. The machine we're dealing with does have curl (7.46.0) installed as well.
We tried reinstalling the git client a couple of times entirely from git-scm.com as well as gitforwindows.org, both resulting in the same error.
Any help or pointer to get this fixed is highly appreciated.
I just fixed the error in my build env. hope my solution is useful to you.
my env: Windows10+Jenkins+git
git version 2.18.
I just reinstall the git into windows, with a different selection during the installation:"MINTTY". after reinstall, I found the remote-https under my git install directory.
also, you need to set the jenkins env. make sure that the new git path which was included in the Jenkins env configure. if you "echo %Path%", and you can find the new git path which included the remote-https, then you are fine.

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.

Removing winmerge from git

I have a Windows 7 computer at work that someone else used before I joined the company. They have git setup with winmerge. While it may be a good idea, I want to remove it and return to a basic "default" git installation.
I tried uninstalling git and gitextensions (which I found on the computer) and after the restart I reinstalled git. I still see the same winmerge options when I do git config --list.
Here is a screenshot of what it is telling me. How would I restore this computer to a default install without winmerge? Thanks in advance!
Screenshot from git config --list
Or here is the code (not that "$REMOTE" is from the previous line)
core.editor="C:/Program Files (x86)/GitExtensions/GitExtensions.exe" fileeditor
merge.tool=DiffMerge
diff.guitool=winmerge
credential.helper=!\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\"
difftool.winmerge.path=C:/Program Files (x86)/WinMerge/winmergeu.exe
difftool.winmerge.cmd="C:/Program Files (x86)/WinMerge/winmergeu.exe" -e -u "$LOCAL" "$REMOTE"
mergetool.DiffMerge.path=C:/Program Files (x86)/WinMerge/winmergeu.exe`
Like #AndrewC said in the comments, you can delete the .gitconfig file found in your user profile (C:\Users\User\.gitconfig).
Alternatively, you can do git config --global --edit and manually delete the lines from the file opened.

`git add` doesn't add files to track on Windows

I have a local folder which I wanted to convert to a Git repository and then push to a remote repository. I ran the command git init in the project folder and then used the command git add .. When I run the command git status, I get the message that I have untracked files. I ran the git add . command multiple times but I see the same message.
What should I do to track these files so I can push to a remote repo?
I'm using Windows 8.1 x64 machine.
UPDATE: Please see the answer below.
I used the command git config --system core.longpaths true to fix the error for longer file names. I was able to add all files after making that change.

Store https passwords with cygwin's Git

I am using Cygwin and Git. Every time I push/pull to a repo on Bitbucket with a https url I am asked to enter a password.
Is there a way to store these credentials (like with ssh-keys)?
I tried to install Windows Credential Store for Git but I can't get it to work with cygwin's Git.
Thanks!
Update:
I found my answer here: Is there a way to skip password typing when using https:// on GitHub?
Summarized:
Remember passwords for 15 minutes (default):
git config --global credential.helper cache
Remember passwords for 10 hours:
git config --global credential.helper 'cache --timeout=36000'
Store passwords (didn't try this):
git config --global credential.helper store
Reset:
git config --unset --global credential.helper
Cim
The way OP answered his own question is one way to go about it.
The Windows Credential Store project was discontinued in 2015. Its original author suggests to use Git Credential Manager for Windows, maintained by Microsoft. Their installer is focused on Git for Windows, however the program itself works well with Cygwin, you just have to install it manually.
Go the GCMW's latest release, download the zip file (not the installer), extract its contents (only .dll and .exe files are needed) to C:\cygwin\usr\libexec\git-core\ for 32-bit Cygwin, or C:\cygwin64\usr\libexec\git-core\ for 64-bit Cygwin. Reference
To get git to use GCMW, execute: git config --global credential.helper manager
To get GUI prompts for credentials, execute: git config --global credential.modalprompt true
If you want this to be a per-repository setting, remove the --global option.
I made Windows Credential Store working with cygwin. The only thing that needs to be changed is global ~/.gitconfig file.
Change 'helper' value which can be found usually at the end of the file to the following:
[credential]
helper = !'/cygdrive/C/Users/<YOUR-ACCOUNT-NAME>/AppData/Roaming/GitCredStore/git-credential-winstore.exe'
For an explanation, cygwin simply uses different paths and the value must follow the rules of course.

Resources