1. 新建分支
git checkout -b D-DSG3017-XZZ
2. 刪除遠(yuǎn)程分支
git push origin --delete D-DSG3017-XZZ
3. 刪除本地分支<注意:先切換到別的分支上才能刪除>
git branch -d D-DSG3017-XZZ
4. 新建分支并切換到該分支:
git checkout -b D-scrollTop-XZZ
5. 提交分支到遠(yuǎn)程
git push origin D-scrollTop-XZZ:D-scrollTop-XZZ
但是提交不了 報(bào)錯(cuò): 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
錯(cuò)誤原因:git POST 緩沖區(qū)過(guò)小.
解決方案:輸入以下命令行 再重新提交就OK了
git config http.postBuffer 524288000
6.切換到遠(yuǎn)程分支
git checkout -b V5.2.6 origin/V5.2.6
作用是checkout遠(yuǎn)程的V5.2.6分支炬丸,在本地起名為V5.2.6分支攒射,并切換到本地的V5.2.6分支