git is using https even with ssh urls

Viewed 38

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 git@github.com: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 = git@github.com: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 = git@github.com:G******/rn-submodule-******.git
[submodule "src/shared/rn-submodule-button-****"]
    active = true
    url = git@github.com: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!

1 Answers

You have this

[url "https://github.com"]
    insteadOf = "git@github.com:"

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
Related