I generated the ssh pub key and private key and register pub key to my github. And add the private key by using this
$ eval $(ssh-agent -s)
$ ssh-add ~/.ssh/id_rsa
But I have to put this command everytime when I push or pull the code. I hope to avoid this.
You should not have to write those commands everytime.
First, the agent is only needed if your private key is passphrase protected.
Second, as explained in "Working with SSH key passphrases", you should be able to automatically launch said agent through a ~/.bashrc
resource file, or (for Mac) caching the passphrase in the keychain.