Git配置文件

来源:互联网 发布:胎动检测的软件 编辑:程序博客网 时间:2024/05/16 06:49
1. 配置别名
用git st表示git status
$ git config --global alias.st status$ git stOn branch masterYour 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

0 0