1. 程式人生 > 實用技巧 >[技術學習] Git 常用命令

[技術學習] 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 "[email protected]"

// get git info
git config -l


#Show ALL Configure information

meteor@cdc-cloud17:~/code_base/common/csc_api_ms$ git config -l
[email protected]
user.name=Tony Ben
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=ssh://[email protected]:7999/ccl/csc_api_ms.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.develop.remote=origin
branch.develop.merge=refs/heads/develop
branch.prod.remote=origin
branch.prod.merge=refs/heads/prod
branch.stage.remote=origin
branch.stage.merge=refs/heads/stage

#Show Only Global Infomation
meteor@cdc-cloud17:~/code_base/common/csc_api_ms$ git config --global -l
[email protected]
user.name=Tony Ben

#Show Only Local Information
meteor@cdc-cloud17:~/code_base/common/csc_api_ms$ git config --local -l
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=ssh://[email protected]:7999/ccl/csc_api_ms.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.develop.remote=origin
branch.develop.merge=refs/heads/develop
branch.prod.remote=origin
branch.prod.merge=refs/heads/prod
branch.stage.remote=origin
branch.stage.merge=refs/heads/stage