下面是生成方法: 1 :打開終端 輸入 ssh-keygen 而後系統提示輸入文件保存位置等信息,連續敲三次回車便可,生成的SSH key文件保存在中~/.ssh/id_rsa.pub cd /Users/userName/.ssh/github_rsa.pub 2 而後用文本編輯工具打開該文件,我用的是vim,因此命令是: vim ~/.ssh/id_rsa.pub
https://git.oschina.net/oschina/git-osc/wikis/幫助#ssh-keys
git
幫助頁面歷史 工做流程 安裝設置 git 下載最新版本的git http://git-scm.com/downloads 當你安裝完成git的時候,你須要簡單的配置一下,打開終端: 用戶名 第一步,你須要告訴git你的名字,這個名字會出如今你的提交記錄中。 git config --global user.name "你的名字" Email 而後是你的Email,一樣,這個Email也會出如今你的提交記錄中,請儘可能保持此Email和您的Git@OSC的註冊Email一致。 git config --global user.email "你的Email" Clone 和 Push Clone 項目 git clone http://git.oschina.net/xxxxxx/xxxxxx.git 建立特性分支 git checkout -b $feature_name 寫代碼,提交變動 git commit -am "My feature is ready" 將你的提交推送到 Git@OSC git push origin $feature_name 在提交頁面你能夠查看你的變動,例如: http://git.oschina.net/oschina/git-osc/commit/f3dd1c5bae48fa4244e2595a39e750e5606dd9be 建立一個 pull request 你能夠fork任意的公開項目,當你修改了你fork的項目,你能夠向源項目提交pull request。項目的做者在審閱過代碼後能夠決定是否將此變動應用到源項目。 在GIT@OSC上使用SVN 使用教程已經整理在這裏 SSH Keys SSH key 能夠讓你在你的電腦和 Git @ OSC 之間創建安全的加密鏈接。 你能夠按以下命令來生成sshkey ssh-keygen -t rsa -C "xxxxx@xxxxx.com"# Creates a new ssh key using the provided email # Generating public/private rsa key pair... 查看你的public key,並把他添加到 Git @ OSC http://git.oschina.net/keys cat ~/.ssh/id_rsa.pub # ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc.... 添加後,在終端(Terminal)中輸入 ssh -T git@git.oschina.net 若返回 Welcome to Git@OSC, yourname! 則證實添加成功。