InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Git tutorials

  • Github for beginners
  • Undo last commit
  • List git branches
  • Git checkout remote branch
  • Diff two branches
  • Show log of one user's commits
  • View diff for a given commit id
  • Setup password less git push for github
  • Git - Check if a hash is valid
  • Git - display specific length commit hash
  • Git - rename local branch
  • Git create branch
  • Git delete branch
  • Git detached head
  • Git display info of last commit (HEAD) in one line
  • Git display local HEAD location
  • Git log with file names
  • Git show details of a commit hash
 
  • Home
  • > Tutorials
  • > Git

How to setup password less git push for github

By admin on Dec 16, 2015

You can use user and password based authentication to push git changes to GitHub. But it is cumbersome to type user and password with every push. A better alternative is to use ssh key for authentication while pushing. Here are steps to setup ssh key based password less authentication with GitHub.

Create a ssh public and private keys

First create a public/private key for authentication. You can create ssh key pair (without passphrase) as mentioned in the linked tutorial. You can use the following location for two generated files.

  1. ~/.ssh/id_rsa.github
  2. ~/.ssh/id_rsa.github.pub

Add public keys to GitHub

  1. Goto GitHub settings page:
    github-setting-menu-item
  2. Add you public keys to GitHub by copying content from ~/.ssh/id_rda.github.pub
    github-ssh-add-key-interface
  3. Once you add your public key, you should see it in the list of keys in your account.
    github-account-ssh-keys-list

GitHub config on you local machine

  1. First setup remote.origin.url using
    $ git config  remote.origin.url git+ssh://git@github.com/youriserid/repoid.git
    

    Old : https://github.com/youriserid/repoid.git
    New: git+ssh://git@github.com/youriserid/repoid.git

  2. To see all git config values and validate if remote.origin.url has been set

    $ git config -l
    
  3. Now add the following lines to you ~/.ssh/config to ssh that for github servers we want to use git key

    Host github.com
    IdentityFile ~/.ssh/id_rsa.github
    

    Test that you can ssh to github

    $ ssh -T git@github.com
    Hi user1! You've successfully authenticated, but GitHub does not provide shell access.
    
  4. Now make any test change and commit locally. To push to origin run the following and it should not ask for password.

    $ git push origin master
    

Suggested posts:

  1. How to change twitter handle and its impact on traffic
  2. Linux how to modify a user using usermod
  3. Generate ssh public key from private key on command line
  4. How to locally override website domain (or hostname) to IP mapping
  5. How to use preview to add password to pdf file on mac
  6. How to create ssh public/private keys on command line
  7. Ubuntu – reload iptables rules during boot
  8. Linux – how to enable password login on ssh server
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Devops, Git, Github, Linux, Mac, SSH, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress