Step 1: Check for SSH keys
$ git config --global user.name "abcd" $ git config --global user.email abcd@efgh.com
First, we need to check for existing SSH keys on your computer. Open up your Terminal and type:
ls -al ~/.ssh
Step 2: Generate a new SSH key
$ ssh-keygen -t rsa -C "your_email@example.com"
$ eval "$(ssh-agent -s)"$ ssh-add ~/.ssh/id_rsa$ sudo apt-get install xclip
$ xclip -sel clip < ~/.ssh/id_rsa.pub
把id_rsa.pub 里的key 复制到github,的key field里。Step 3: Test everything out
$ ssh -T git@github.com
出现sucessfully 表示成功。Step 4: Use
$ git init $ touch README $ git add README $ git commit -m 'first commit' $ git remote add origin git@github.com:abcd/tmp.git $ git push -u origin master