git 常用命令(自用
配置个人信息
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
关联远程库
git remote rm origin 删除关联的origin的远程库
git remote add origin https://gitee.com/xxxxxx.git 关联自己的仓库
git clone https.xxx 默认克隆
git clone --branch <branchname> <remote-repo-url> #克隆远程分支
git add .
git commit -m '描述'
git push --set-upstream origin dev1 #将分支推送到远程仓库
git push -u origin --all #默认推送
切换分支
git checkout -b dev 创建切换分支
git checkout master 切换到主分支
git merge dev 将dev合并到主分支