• 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
    
    
  • 相关阅读:
    回调函数(C语言)
    main函数的参数(一)
    术语,概念
    [LeetCode] Invert Binary Tree
    关于overload和override
    第一个只出现一次的字符
    Manacher算法----最长回文子串
    C++对象模型
    回文判断
    字符串转换成整数
  • 原文地址:https://www.cnblogs.com/Jacck/p/14296133.html
Copyright © 2020-2023  润新知