git縮寫配置:
在.gitconfig文件中添加:
[alias]
br = branch
co = checkout
ci = commit
st = status
last = log -1 HEAD
git常用操作:
git clone 克隆一個分支
git br 查看分支,-a參數(shù)可列出所有分支
git co -b from_xxx 新建一個分支
git st 顯示差異
git add xxx 添加文件
git diff 比較差異
git commit -a -m "xxx" 提交修改
git log 查看日志
git push origin from_xxx:from_xxx (git push) 推到遠程倉庫
git pull 拉取遠程分支,并合并到本地
git fetch 拉取遠程數(shù)據(jù),不自動合并
git merge 合并分支
git blame -p filename 查看修改人
git tag 標簽相關(guān)
git branch -d 刪除分支
git remote -v 顯示對應的地址
git rebase 變基合并
本文集「程序員的自我修養(yǎng)」所有文章著作權(quán)歸作者所有,轉(zhuǎn)載請附原文鏈接。