使用git和github托管个人项目

 

      1.  安装 cygwin 和 cygwin 下的 git , 测试 git 命令可用;   参考: https://cygwin.com/install.html

 

      2.  注册 github 账号; https://github.com  

      3.  登陆 cygwin ,  生成 SSH key , 存入 github;

                 git config --global user.name "your_github_name"    (1)

                 git config --global user.email "your_github_email"    (2)

                 ssh-keygen -t rsa -C "your_github_email"                  (3)

                 cat  ~/.ssh/id_rsa.pub                                                 (4)

                 将 (4) 的内容拷贝到个人账号的 setting - SSHKEYs 里。 由于多台电脑均需要各自的 sshkey, 赋予清晰的名称, 比如家里的叫 home-sshkey。    

      4.  验证可访问性:  

                ssh -T git@github.com  

                Hi shuqin! You've successfully authenticated, but GitHub does not provide shell access.   

                如果出现错误:  Agent admitted failure to sign using the key. Permission denied (publickey). 执行命令 ssh-add 解决。

      5.  在 github 上创建 Repository :  见 github 指南, 注意勾选 "Initialize this repository with a README"

      6.  在本地创建 Repository 副本:    git clone git@github.com:shuqin/pystudy.git            

      7.  添加文件, 提交远程仓库: git add .  ;  git commit -m 'init project'  ;  git status ;  git push origin master

      8.  在 GitHub.com 相应项目的 Repository 下查看源码文件是否成功上传。

 

      参考文章: 

      http://blog.csdn.net/yangbo_hbzjk/article/details/9022767

 

      我的相关项目:

      1. pystudy 正在学习中。。。  https://github.com/shuqin/pystudy

      2. ALLIN: 集合我所学到的Java相关的东西。。。 https://github.com/shuqin/ALLIN

 

      工欲善其事, 必先利其器。 要尽可能使用先进的工具来完成事情。 程序员, 工程师, 是领略时代前沿的族群, 更要敢于走在前面。

 

posted @ 2014-11-08 21:44  琴水玉  阅读(517)  评论(0编辑  收藏  举报