[技术学习] Git 常用命令

GIT Config

设置global 信息

//Note: if not use global , will set the score in only this repo . 
git config --global user.name "Tony Ben"
git config --global  user.email "tony.ben@gmail.com"

// get git info
git config -l

// add additinal configure
git config [--local|--global|--system] --add section.key value(默认是添加在local配置中)
// get configure
git config [--local|--global|--system] --get section.key(默认是获取local配置中内容)
// delete
git config [--local|--global|--system] --unset section.key

#Show ALL Configure information

xx@xxx:$ git config -l
user.email=tony.ben@gmail.com
user.name=Tony Ben
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=ssh://git@xx/xxx.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

#Show Only Global Infomation
xx@xx:~/code_base/common/csc_api_ms$ git config --global -l
user.email=tony.ben@gmail.com
user.name=Tony Ben

#Show Only Local Information
meteor@cloud17:$ git config --local -l
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=ssh://git@xx.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

 

 

posted @ 2020-12-01 11:13  TonyBen2018  阅读(143)  评论(0编辑  收藏  举报