Git 常用命令

Git Reference
The most useful git commands

  1. git branch
    列出所有分支

  2. git branch -v
    查看各个分支最后一次提交

  3. git branch -merged
    查看哪些分支合并入当前分支

  4. git branch -no-merged
    查看哪些分支没有合并入当前分支

  5. git branch branch-name
    创建分支

  6. git checkout branch-name
    切换分支

  7. git checkout -b branch-name
    创建并切换分支

  8. git branch -d branch-name
    删除分支

  9. git branch -D branch-name
    强制删除分支

  10. git rebase branch-name
    更新branch-name分支上的内容到当前分支上

  11. git remote -v
    显示远程信息

  12. git remote show origin
    显示本地和远程分支跟踪情况

  13. git log --graph --oneline --decorate --all
    树状显示所有分支演进路线

posted @ 2015-05-20 10:24  ThreeTree  阅读(180)  评论(0编辑  收藏  举报