常用GIT命令大全
阿新 • • 發佈:2019-01-13
配置使用者資訊:
用如下命令配置使用者名稱和使用者郵箱,只用配置一次。
git config --global user.name ""
git config --global user.eamil ""
檢視配置的資訊:
git congfig --list
克隆已經存在的倉庫
git clone [url]
git狀態檢視命令
git status
遠端倉庫的使用
檢視自己已經關聯的遠端分支:
git remote
git remote -v 不單可以檢視分支的簡寫,還可以包含了簡寫名稱對應的url
新增遠端倉庫
git remote add 簡寫名稱 <url>
從遠端分支中抓取所有分支的引用
git fetch [remote-name]
推送到遠端倉庫
git push [remote-name] [branch-name]
檢視遠端倉庫
git remote show [remote-name]
移除遠端倉庫
git remote rename
分支管理
移除分支
git branch 分支名
分支切換
git checkout 分支名
刪除分支
git branch -d 分支名
查詢程分支: git branch -a
切換到遠端分支: git checkout -b develop origin/NCE_Develop