Switching Git to use SSH

I have an SSH key set up and added to Git servers. Even then, while using Git from my command line, it still uses username and password for authentication. Is there are any command to change my authentication mechanism.

  • Can I change my .gitignore at a remote site and will it push to GITHUB repro when I do a git push?
  • How to append tab on every new line in a custom pretty log format?
  • git push --recurse-submodules=on-demand is not truly recursive
  • Migrate git repo from Google Code to Github
  • Git Rewrites all lines in a file?
  • git cloning behind proxy — different behavior, same command
  • Can I version dotfiles within a project without merging their history into the main line?
  • Git-tfs reset to remote
  • git pull origin master keeping the settings.py
  • Can I force git to use TLS only?
  • How should I proceed building an application after cloning a boilerplate?
  • Can't checkout to other branches because ignored file has local changes?
  • 2 Solutions collect form web for “Switching Git to use SSH”

    I believe you’re looking for credential helpers. Check out the git documentation here: https://www.kernel.org/pub/software/scm/git/docs/v1.7.9/gitcredentials.html

    My guess is that git config --global credential.helper cache will do the trick.

    If you’re on a mac and installed git using homebrew you can use this: git config --global credential.helper osxkeychain.

    There’s another stack overflow question with answers that go more in depth about git credentials here: Is there a way to skip password typing when using https:// on GitHub?.

    Hope this helps!

    Did you set your remote branch URL using git protocol?

    You can set by

    git remote set-url origin [SSH protocol URL]

    SSH protocol URL looks like git@github.com:torvalds/linux.git

    Git Baby is a git and github fan, let's start git clone.