設置用戶信息git
git config -global user.name "your name" git config -global user.email youremail@email.com
初始化倉庫github
git init
加入文件數據庫
git add *.c git commit -m 'Your Information'
克隆現有倉庫安全
git clone https://github.com/elegantking/PythonSpiderGuide
若是想定義本地的倉庫名稱,能夠使用在後面加入本身的名稱,例如服務器
git clone https://github.com/elegantking/PythonSpiderGuide MyPythonProject
檢查當前文件狀態ide
git status
查詢文件更新哪些部分fetch
git diff
刪除指定文件ui
git rm file
查看提交歷史code
git log
顯示每次提交的內容差別orm
git log -p -2
查看已經配置的遠程倉庫服務器
git remote
從遠程倉庫中獲取新的數據
git fetch [remote-name]
推送到遠程倉庫
git push
移除遠程倉庫
git remote rm [remote-name]
建立分支
git branch [name]
切換到指定分支
git checkout [name]
合併分支
git merge [name]