赞
踩
git config --global user.name "你在github上的用户名" git config --global user.email 注册的邮件地址mkdir ~/.sshcd ~/.ssh ssh-keygen -t rsa -C "注册的邮件地址"cat id_rsa.pub
Global setup: Set up git git config --global user.name "user_name" git config --global user.email ×××@×××.com Add your public keyNext steps: mkdir project_name cd project_name git init touch README git add README git commit -m 'first commit' git remote add origin git@github.com:user_name/project_name.git git push -u origin masterExisting Git Repo? cd existing_git_repo git remote add origin git@github.com:user_name/project_name.git git push -u origin masterImporting a Subversion Repo? Click hereWhen you're done: Continue
“Permission denied (publickey).fatal: The remote end hung up unexpectedly”
$ cd ~/.ssh
$ ls# 显示来当前目录下的所有子目录# config id_rsa id_rsa.pub known_hosts$ mkdir key_backup# 在当前目录下创建一个叫做"key_backup"的子目录$ cp id_rsa* key_backup# 备份以前的key文件到上面新建的文件夹中$ rm id_rsa*# 删除旧的key文件
$ ssh-keygen -t rsa -C "your_email@youremail.com"# 使用一个私人的email地址,来生成一个ssh key# 生成 公开/私有 的一对key(Generating public/private rsa key pair.)# 输入要保存key文件的目录(enter键 使用括弧里面的默认设置)(/Users/your_user_directory/.ssh/id_rsa):<press enter># 然后输入一个密码(passphrases)这个密码可以不用输入,直接回车就可以了,要不然每次提交代码都要输入密码Enter passphrase (empty for no passphrase):<enter a passphrase>Enter same passphrase again:<enter passphrase again>
Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub.The key fingerprint is:01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db user_name@username.comThe key's randomart image is:+--[ RSA 2032]----+| .+ + || ssssssss || = * * || o = + || ssss . || o oss || o .sE || || |+-----------------+
$ ssh -T git@github.comAttempts to ssh to githubWhich should give you this:The authenticity of host 'github.com (207.97.227.239)' can't be established.RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.Are you sure you want to continue connecting (yes/no)?Don’t worry, this is supposed to happen. Type “yes”.Hi username! You've successfully authenticated, but GitHub does not provide shell access.Having problems?
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。