git 命令大全

132 阅读1分钟

git常用命令

// 创建版本库

git clone  <url>                              # 克隆远程版本库
git init                                      # 初始化本地git仓库(创建新仓库)

// git全局设置

git config --global user.name "账号"
git config --global user.email "邮箱"

// 添加缓存区

git add .

// 提交暂存区

git commit -m 'xxx'  

// 将add和commit合为一步

git commit -am 'xxx'

// 拉取

git pull

// 推送

git push

git分支管理

git branch                    查看分支命令
git branch     <branchname>   创建分支命令
git checkout   <branchname>   切换分支命令
git merge      <branchname>   合并分支命令
git branch -d  <branchname>   删除分支命令

持续更新中...