1 仓库配置相关
// 查看当前仓库配置
git config --list
// 查看全局仓库配置
git config --global --list
// 查看当前仓库用户名、密码
git config --get user.name
git config user.name
git config --get user.password
git config user.password
// 配置全局仓库账户名密码
git config --global credential.helper store
git config --global user.username "username"
git config --global user.password "password"
// 配置local仓库账户名密码
git config --local credential.helper store
git config --local user.username "username"
git config --local user.password "password"
2 Git Branch相关
git branch 查看本地所有分支
git branch -a 查看所有分支
git branch -r 查看远程分支
git branch -vv 查看追踪分支
git branch --v 查看当前分支最后一次提交日志
3 推送
// 推送当前分支最新代码(远端已有对应分支)
git push
// 将本地新分支推送到远端分支(在远端创建一个分支)-u与--set-upstream一个意思
git push -u origin dev
或
git push --set-upstream origin dev