1. 程式人生 > >如何用命令將本地專案上傳到git和ssh配置

如何用命令將本地專案上傳到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裡新增