首先是上传服务器上的网站到github仓库
git init
git add .
git commit -m ‘‘
关联远程仓库,先去github上新建一个,new repository
git remote add origin 你的远程库地址
同步 合并
git pull --rebase origin master
推送
git push -u origin master
克隆
git clone git@github.com:jaxma/pig.git pig
ssh的问题
查看有没有id_dsa.pub
cd ~/.ssh
没有的话
ssh-keygen -t rsa -C "your_email@youremail.com"
比如我的
git@github.com:jaxma
cat ~/.ssh/id_rsa.pub
复制公钥
到SSH and GPG keys里添加
如何用命令将本地项目上传到git和ssh配置
原文地址:http://blog.51cto.com/1105190775/2317184