Git配置文件

1. 配置别名
用git st表示git status
$ git config --global alias.st status
$ git st
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean
--global參数是全局參数,也就是这些命令在这台电脑的全部Git仓库下都实用。




2. 查看当前用户配置文件

$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
        hideDotFiles = dotGitOnly
[remote "origin"]
        url = git@github.com:morris131/gittest.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
[branch "dev"]
        remote = origin
        merge = refs/heads/dev

3. 查看全局配置文件
$ cat ~/.gitconfig
[gui]
[user]
        name = morris131
        email = morris131@163.com
[gui]
        recentrepo = E:/javaPrj/morris-tool
[alias]
        st = status

posted @ 2018-01-14 11:41  zhchoutai  阅读(336)  评论(0编辑  收藏  举报