2011年4月24日星期日

尝试开源项目

一直想尝试参与或者建立一个开源项目,在github建立账户也有一段时间了,今天终于迈出了第一步。github 提供非常好的说明和指导,整个过程中,首次push remote碰到ssh连接的问题,github 也提供了相关的解决方法, 顺利解决。另外就是不太熟悉git的操作。

整个过程如下(Linux):
  1. 建立GitHub账户,开源空间免费
  2. 创建ssh连接
    • $cd ~/.ssh
    • $ssh-keygen -t rsa -C "your_email@youremail.com"
    • 使用默认密钥文件名
    • 输入passphrase
    • $ssh-add ~/.ssh/id_rsa
    • $vi ~/.ssh/id_rsa.pub
    • 在GitHub用户管理页面中加入公共密钥(id_rsa.pub的内容)
    • 测试连接,$ssh git@github.com
  3. 在github用户,Dashboard页面,点击“New Repository”创建新的项目,比如FileSync
  4. 配置git
    • git config --global github.user "your username"
    • git config --global user.email "your email"
  5. CheckIn代码
    • $cd ~/${workspace}/FileSync
    • $git init
    • $git add README pom.xml ./src
    • $git commit -m "initial commit"
    • $git remote add origin git@github.com:user-name/FileSync.git
    • $git push origin master

没有评论:

发表评论