zoukankan      html  css  js  c++  java
  • git别名设置

    $ git config --global alias.co checkout

    $ git config --global alias.br branch

    $ git config --global alias.ci commit

    $ git config --global alias.st status

    $ git config --global alias.last 'log -1 HEAD'

    $ git config --global alias.tree "log --graph --decorate --pretty=oneline --abbrev-commit"

     
    • 这意味着,当要输入 git commit 时,只需要输入 git ci。 随着你继续不断地使用 Git,可能也会经常使用其他命令,所以创建别名时不要犹豫。
    • 通常也会添加一个 last 命令,像这样:
        $ git config --global alias.last 'log -1 HEAD'

        这样,可以用git last命令轻松地看到最后一次提交

    •  个人习惯添加了一个git tree和 git hist(两个其实指向一个指令)
      •   

        $ git config --global alias.tree "log --graph --decorate --pretty=oneline --abbrev-commit"

        $ git config --global alias.hist "log --graph --decorate --pretty=oneline --abbrev-commit"   

    
    
     直接修改用户下的.gitconfig文件也可以,其中alias一项为:
    [alias]
        co = checkout
        br = branch
        ci = commit
        st = status
        tree = log --graph --decorate --pretty=oneline --abbrev-commit
        hist = log --graph --decorate --pretty=oneline --abbrev-commit
        last = log -1 HEAD
    
    
  • 相关阅读:
    session验证登陆- 页面跳转
    SQL 语句
    MD5加密
    【JS】布尔逻辑
    一道题
    正则表达式
    被搁置的生活 by刘瑜
    LoadRunner 12下载和安装教程
    Delphi Idhttp Post提交 Aspx/Asp.net 时 500错误的解决办法。
    phpmyadmin 4.x 版本无法看到登录框的处理
  • 原文地址:https://www.cnblogs.com/Jacck/p/14296133.html
Copyright © 2011-2022 走看看