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
    
    
  • 相关阅读:
    (2015年郑州轻工业学院ACM校赛题) B迷宫
    (2015年郑州轻工业学院ACM校赛题) A 彩票
    POJ 1861 Network
    动态逆序对
    K大数查询
    Dynamic Rankings
    Cleaning
    Boxes
    P3601 签到题
    How many integers can you find
  • 原文地址:https://www.cnblogs.com/Jacck/p/14296133.html
Copyright © 2011-2022 走看看