查看當前分支 :git branch
>> git branch
a_branch
b_branch
* master
切換分支/創建分支(當此分支不存在是將會創建此分支):git checkout branch_name
##切換到a_branch分支
>> git checkout a_branch
如果你要將現有倉庫的代碼克隆下來:git clone url
git clone https://github.com/...
如果你要取回遠程某一分支的提交:git pull origi如果我們已經通過git cn branch_name
git pull origin branch_name
上傳文件
git add .
git commit -m "your annotation"
git push origin branch_name
git commit
撤銷操作:
git reset --soft HEAD^
git add 和 git commit
撤銷:
git reset --mixed HEAD^
git status
查看當前狀態