git init git初始化
reset 清屏
git remote 列出已經存在的遠程分支
git remote get-url origin Git遠程獲取URL的起源
ctrl+c:結束命令
git pull origin master 從遠程庫拉取更新到本地(這個項目如果是多人維護的話,有人更新了這個項目,你要同步別人的修改到你的本地)
設置用戶:
-> git config --global user.name "shimilygood" 設置用戶,方便以后不用每次上傳數據都要輸入用戶名
-> git config --global user.email "1356300819@qq.com" 郵箱
-> cd ~/.ssh 設置ssh
-> ssh-keygen -t rsa -C "1356300819@qq.com" 設置ssh-key
-> cd ~/.ssh
-> ssh -T git@github.com
克隆數據:
-> git clone git@github.com:nodejs-team/mcake-activity.git 從github上克隆數據到本地 (要使用ssh路徑)
-> git remote add origin url git@github.com:nodejs-team/mcake-activity.git
-> git remote get-url origin Git遠程獲取URL的起源
git上傳操作三部曲:
-> git add .
-> git commit -m "add test-wap"
-> git push origin master
git刪除操作三部曲:
-> rm -r app/test-wap/ 刪除文件夾
-> git add . 添加所有(.表示所有)
-> git commit -m "delete test-wap" 添加注釋
-> git push origin master push同步上傳分支
從github上下載新項目數據:(克隆)
-> git clone git@github.com:nodejs-team/mcake-activity.git (要使用ssh路徑)
從遠程庫拉取更新到本地
-> git pull origin master 從遠程庫拉取更新到本地
(這個項目如果是多人維護的話,有人更新了這個項目,你要同步別人的修改到你的本地)
