如何用命令将本地项目上传到git和ssh配置

嘛,就是将服务器上的网站和本地同步。
首先是上传服务器上的网站到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 [email protected]:jaxma/pig.git pig

ssh的问题
查看有没有id_dsa.pub

cd ~/.ssh

没有的话

ssh-keygen -t rsa -C "[email protected]"

比如我的

[email protected]:jaxma

cat ~/.ssh/id_rsa.pub

复制公钥

到SSH and GPG keys里添加

猜你喜欢

转载自blog.51cto.com/1105190775/2317184