2020年 · Linux · 点滴记录

Git查看本地配置信息

  • config 配置指令
    config 配置有system级别 global(用户级别) 和local(当前仓库)三个 设置先从system-》global-》local 底层配置会覆盖顶层配置 分别使用–system/global/local 可以定位到配置文件
  • 查看系统config
    $ git config –system –list
    diff.astextplain.textconv=astextplain
    filter.lfs.clean=git-lfs clean — %f
    filter.lfs.smudge=git-lfs smudge — %f
    filter.lfs.process=git-lfs filter-process
    filter.lfs.required=true
    http.sslbackend=openssl
    http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
    core.autocrlf=true
    core.fscache=true
    core.symlinks=false
    credential.helper=manager
  • 查看当前用户(global)配置
    $ git config –global –list
    user.email=244234950@qq.com
    user.name=bruce
  • 查看当前仓库配置信息
    $ git config –local –list
    core.repositoryformatversion=0
    core.filemode=false
    core.bare=false
    core.logallrefupdates=true
    core.symlinks=false
    core.ignorecase=true
    remote.origin.url=http://git.ohyeahwoo.com/myprojects/blog_web.git
    remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
    branch.master.remote=origin
    branch.master.merge=refs/heads/master
  • 查看user.name
    $ git config user.name
    bruce
  • 查看user.email
    $ git config user.email
    244234950@qq.com
  • 修改user.name
    Administrator@SC-201912080501 MINGW64 ~
    $ git config –global –replace-all user.name “bruce111”

    Administrator@SC-201912080501 MINGW64 ~
    $ git config user.name
    bruce111

  • 修改user.email
    Administrator@SC-201912080501 MINGW64 ~
    $ git config –global –replace-all user.email “sssss@163.com”

    Administrator@SC-201912080501 MINGW64 ~
    $ git config user.email
    sssss@163.com