git: 'remote-https' is not a git command?

Whenever I attempt to clone, push or pull I get:

C:\Users\User\Documents\Project>git pull

git: 'remote-https' is not a git command. See 'git --help'.

Committing and adding still work fine.

Upvotes: 53

Views: 107446

Answers (13)

Tony Wu
Tony Wu

Reputation: 1107

If you look for git-remote-https in your machine, you should find it located under somewhere like C:\Program Files\Git\mingw64\libexec\git-core.

Add this directory to the Environmental variable "Path".

Then, re-open your command prompt and run the git pull command again.

This works for me.

Upvotes: 1

Md Ruman Islam
Md Ruman Islam

Reputation: 11

I encountered a similar issue on Ubuntu. However, I was able to resolve the problem by installing Git directly on the base system rather than relying on Conda's version. If you're facing a similar issue, consider installing Git on your base system as it might help resolve the problem.

Upvotes: 0

FHenderson
FHenderson

Reputation: 41

In my case, a windows 10 update created some registry blocker (which were left behind after the update)

I just needed to delete the following registry key

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\git-remote-https.exe]
"Debugger"="\"C:\\windows\\SoftwareDistribution\\Download\\Install\\patchmypc-preventstart.exe\" /StopProcess /ApplicationName=\"git-remote-https.exe\"" 

Upvotes: 0

David
David

Reputation: 37

I had the same issue, but mine was a bit different situation, when I added a git remote there was I typo in url's https part, so it would give me the same error, always go ahead and check your remote urls from cmd with git remote -v

Make sure that the provided url is the same from Github.

Upvotes: 1

Mikhail T.
Mikhail T.

Reputation: 3967

This points at an incomplete -- or otherwise busted -- installation. Git is looking for -- and is unable to find -- one of its auxiliary executables: git-remote-https.

If you used some sort of installer on Windows, try rerunning the installation... If you built it from source -- make sure to let the build process do the install itself, rather than manually copying git.exe (and omitting all the other binaries it needs).

Upvotes: 2

mmortal03
mmortal03

Reputation: 771

I was using Entware and had installed git using opkg install git and was getting this error. Installing git-http fixed it for me, i.e. opkg install git-http. This also helps on OpenWrt based systems.

Upvotes: 66

yeahnoob
yeahnoob

Reputation: 111

Note:

  • If after build and install git from the latest source code, this issue is occurred, continue..
  • If not, just ignore this answer..

Check the command git-remote-https existed or not in your git install path. For me, after build from source and make install, I can check that by

=---------------------=
│git on  HEAD (cd3e6062)
-> ls /usr/local/bin/git*

If that command not existed in path, copy the git-remote-https built from your git source code path to your git install path,

=---------------------=
│git on  HEAD (cd3e6062)
-> sudo cp git-remote-https /usr/local/bin

Upvotes: 2

Dorin
Dorin

Reputation: 1076

Check the URL from .git/config file.

In my case, the error was the remote origin location

[remote "origin"]
    url = "CHECK THIS LOCATION"

I guess the remote location is something like this and the unknown git command 'remote-https' came from an invalid combination of 'remote' + 'https'

[remote "origin"]
    url = https://github.com/user/repo

Upvotes: 2

Pedro Sobota
Pedro Sobota

Reputation: 1877

In my case, I was building Git from source in WSL Ubuntu.

The distribution didn't come with libcurl preinstalled. In this case, the git-remote-http executable was not being built. So I installed it:

sudo apt install libcurl4-openssl-dev

Then, I re-configured, re-maked and re-installed, and Git could clone.

Upvotes: 65

Dwayne Driskill
Dwayne Driskill

Reputation: 1490

I had the same error and I solved by installing the latest version of Git for Windows at https://gitforwindows.org/. This might not be the correct solution for everyone. I had recently uninstalled Git for Windows not realizing that my git GUI, SourceTree, was using it.

Upvotes: 2

Mike Gledhill
Mike Gledhill

Reputation: 29161

I was also having this error, and solved it by running this command:

path %path%;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin

This added the folder where my git-remote-https.exe file was stored.

Upvotes: 13

Abdul Waheed
Abdul Waheed

Reputation: 4678

Today, I was facing the same problem. The problem in my case was wrong path set in android studio to the git execution file. I changed the path of git execution and it worked. According to my git installation the path was C:\Program Files\Git\mingw64\bin\git.exe. I used this path in android studio. By using below steps

  1. File
  2. Setting
  3. version control
  4. git And I pasted the above mentioned path in Path to git exectable

and done.

Hope this helps other.

Upvotes: 7

user829916
user829916

Reputation: 49

I encountered the same thing with the git 2.18.0 or higher version. I downgraded to 2.17.* and it seems to solve the problem. My issue was running git clone through https.

Upvotes: 1

Related Questions