码迷,mamicode.com
首页 > 其他好文 > 详细

Git配置文件

时间:2018-01-14 13:03:36      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:too   mail   rac   alias   etc   sdn   cas   mat   directory   

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

Git配置文件

标签:too   mail   rac   alias   etc   sdn   cas   mat   directory   

原文地址:https://www.cnblogs.com/zhchoutai/p/8282602.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!