DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Push to Github Repository with SSH Keys


I want push to github repository without input username and password.

  1. Add pub key to github account [profile -> settings -> SSH keys];

  2. Set up git default user name and email address with git config --global user.name and git config --global user.email;

  3. Test ssh connection: ssh -T git@github.com;

  4. Modify remote repo address: from https://github.com/USERNAME/OTHERREPOSITORY.git to git@github.com:USERNAME/OTHERREPOSITORY.git, where first replace https:// with git@, then replace github.com/ with github.com:.

Now you can push to github repo (git push origin master) without input username and password.

Ref:

Git push requires username and password

Set Up Git

Generating SSH keys

Changing a remote's URL



Published

Sep 12, 2015

Last Updated

Sep 12, 2015

Category

Tech

Tags

  • github 6
  • push 1
  • ssh 23

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor