git 分支操作

1. 新建分支

git checkout -b  D-DSG3017-XZZ
2. 删除远程分支
git push origin --delete D-DSG3017-XZZ

3. 删除本地分支<注意:先切换到别的分支上才能删除>

git branch -d D-DSG3017-XZZ

4. 新建分支并切换到该分支:

git checkout -b D-scrollTop-XZZ

5. 提交分支到远程

git push origin D-scrollTop-XZZ:D-scrollTop-XZZ

但是提交不了 报错: RPC failed; HTTP 411 curl 22 The requested URL returned error: 411 Length Required
fatal: The remote end hung up unexpectedly

xuzhenzhendeMacBook-Air:shunguangShop xzz$ git push origin D-scrollTop-XZZ
Counting objects: 1044, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (405/405), done.
error: RPC failed; HTTP 411 curl 22 The requested URL returned error: 411 Length Required
fatal: The remote end hung up unexpectedly
Writing objects: 100% (1044/1044), 2.33 MiB | 11.59 MiB/s, done.
Total 1044 (delta 745), reused 877 (delta 595)
fatal: The remote end hung up unexpectedly
Everything up-to-date

错误原因:git POST 缓冲区过小.
解决方案:输入以下命令行 再重新提交就OK了

git config http.postBuffer 524288000

6.切换到远程分支

git checkout -b V5.2.6 origin/V5.2.6 

作用是checkout远程的V5.2.6分支,在本地起名为V5.2.6分支,并切换到本地的V5.2.6分支

你可能感兴趣的:(git 分支操作)