git 常用操作

2020-06-15  本文已影响0人  汀上

# 1.查看git配置信息
$ git config --list
 
# 2.查看git用户名、密码、邮箱的配置
$ git config user.name
$ git config user.password
$ git config user.email
 
# 3.设置git用户名、密码、邮箱的配置
$ git config user.name "name"
$ git config user.password "111"
$ git config user.email "123@123.com"
# 3.设置git用户名、密码、邮箱的配置(全局配置)
$ git config --global user.name 用户命
$ git config --global user.password 密码
$ git config --global user.password 邮箱
 
# 4.修改git用户名、密码、邮箱的配置(没有用户名就添加,有了用户名就修改)
$ git config user.name "name"
# 4.修改git用户名、密码、邮箱的配置(全局配置)
$ git config --global user.name "name"

#5.获取远程仓库所有分支代码
git clone xxx
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
 
上一篇下一篇

猜你喜欢

热点阅读