Pablo gdcr
Pablo gdcr

Reputation: 21

git is using https even with ssh urls

I've been working with github for GitHub time, using an SSH URL. Today, github has decided to use https instead, and refuses to use SSH...

> git clone [email protected]:G******/app-****.git
Cloning into 'app-****'...
Username for 'https://github.com':

If I try to pull the changes from a repo, the result is the same:

> git pull origin master
Username for 'https://github.com':

I don't understand why and haven't find any help so far. My .git/config file is configured to use SSH:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
    hooksPath = .githooks
[remote "origin"]
    url = [email protected]:G******/app-****.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[pull]
    rebase = true
[submodule "src/shared/rn-submodule-******"]
    active = true
    url = [email protected]:G******/rn-submodule-******.git
[submodule "src/shared/rn-submodule-button-****"]
    active = true
    url = [email protected]:G******/rn-submodule-button-****.git

I tried to generate a new ssh key and upload it on my GitHub account but it doesn't solve my issue.

Do you have any idea what is going on?

Thanks a lot!

Upvotes: 1

Views: 444

Answers (1)

phd
phd

Reputation: 94827

You have this

[url "https://github.com"]
    insteadOf = "[email protected]:"

in your $HOME/.gitconfig. This replaces/rewrites URLs on the fly. You need to remove the section from the config:

git config --global --remove-section url.https://github.com

Upvotes: 2

Related Questions