git基本操作

git config --global core.autocrlf false 不会自动将UNIX 格式转换为DOS格式
git config --global user.name "zhangsan"
git config --global user.email "zhangsan@126.com"
ssh-keygen -t rsa -C "zhangsan@126.com"
git branch -a 查看所有分支(远程、本地)
git branch 查看本地分支
git branch test 创建分支
git clone -b beanch_name git@gitlab
git clone ssh:git@gitlab.zhangsan.com
cd dir_test
git chechout test 切换分支
git rm * -rf
git add .
git commit -m "test"
git push origin test 提交分支

git branch -m old_branch new_branch 重命名分支
git push origin --delete old_branch 删除远程分支
git push origin new_branch 将重命名的分支提交
【放弃本地版本,直接覆盖】
git reset --hard
git pull

【克隆远程dev分支】
git clone -b dev git@192.168.234.210:dept/test.git

【合并分支】
git clone https://gitee.com/aa/test.git
git checkout -b dev origin/dev 将本地分支的dev 分支合并与远程dev分支对应
git checkout master #切换到需要合并的分支上
git merge dev #将newBranch合并到master分支上
git push origin master