git 使用总结

保存用户名和密码
    [credential]   
    helper = store

获取仓库:
git clone  http://username:password@192.168.10.5:8114/mdm3-0/web.git

获取分支:
git checkout -b  branch-name  origin/branch-name

将本地分子推到服务器
git push origin ct_demo:md_ct_demo

删除分支
git push origin --delete <branchName>

获取日志:
git log --pretty=oneline --abbrev-commit


添加tag
git tag -a test_r2 -m "Add tag for test"
git push origin test_r2

删除tag
git tag -d 12345
git push origin :refs/tags/12345

撤销未提交的内容

  git checkout  file/dir

回滚已经提交的内容

  git revert

    * git revert HEAD                  撤销前一次 commit
   * git revert HEAD^               撤销前前一次 commit
    * git revert commit-id (比如:fa042ce57ebbe5bb9c8db709f719cec2c58ee7ff)撤销指定的版本,撤销也会作为一次提交进行保存。

异常处理

Error: RPC failed; result=22, HTTP code = 411

原文地址:https://www.cnblogs.com/javawer/p/3995430.html