日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

git删除本地分支、删除远程分支 复制分支

發(fā)布時(shí)間:2023/12/3 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 git删除本地分支、删除远程分支 复制分支 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

git刪除本地分支、刪除遠(yuǎn)程分支

It_BeeCoder?2019-05-15 09:47:20??80268??收藏?15

展開

?

https://blog.csdn.net/lihua5419/article/details/81706905

  • 1、查看所有分支

  • git branch -a

  • 2、查看當(dāng)前所在分支

  • git branch

  • 3、刪除本地的bug_xzx分支

  • git branch -d bug_xzx

  • 4、刪除遠(yuǎn)程的bug_xzx分支

  • git push origin --delete bug_xzx

  • 推薦大家一個(gè)好用的git分支管理工具SourceTree,如下圖所示可以直接從遠(yuǎn)程拉取分支到本地,并且可視化對分支進(jìn)行操作

    ?

    ?

    ?

    ?

    ?

    ?

    git —— 將當(dāng)前分支復(fù)制到新建分支

    一閃一閃亮晶晶,漫天都是小星星 2020-01-09 17:56:44 ?335 ?收藏
    展開
    eg:

    當(dāng)前分支:i-health???新分支:i-health-noTab

    1.?當(dāng)前分支:i-health

    從當(dāng)前分支copy開發(fā)分支
    git checkout -b?i-health-noTab

    運(yùn)行,此時(shí)當(dāng)前分支變?yōu)?i-health-noTab


    2. 把新建的分支push到遠(yuǎn)端
    git push origin??i-health-noTab

    ?

    3。 將分支與遠(yuǎn)端關(guān)聯(lián)?

    git branch --set-upstream-to=origin/i-health-noTab

    ?

    4.拉取代碼成功

    git pull
    ————————————————
    版權(quán)聲明:本文為CSDN博主「一閃一閃亮晶晶,漫天都是小星星」的原創(chuàng)文章,遵循CC 4.0 BY-SA版權(quán)協(xié)議,轉(zhuǎn)載請附上原文出處鏈接及本聲明。
    原文鏈接:https://blog.csdn.net/assassin_0302/article/details/103913300

    ?

    ?

    ?

    ?

    ?

    ?

    ?


    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git branch
    ? feature/switch_db
    ? master
    * ?feature/switch_db_app_res

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git push origin feature/switch_db_app_res
    error: src refspec feature/switch_db_app_res does not match any
    error: failed to push some refs to 'http://git.dev.wochanye.com/gateway/thrall-user.git'

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git push? ? ?上面的命令不行這個(gè)就好了? 推的就是當(dāng)前分支
    fatal: The current branch ?feature/switch_db_app_res has no upstream branch.
    To push the current branch and set the remote as upstream, use

    ? ? git push --set-upstream origin ?feature/switch_db_app_res


    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ ?git push --set-upstream origin ?feature/switch_db_app_res
    Total 0 (delta 0), reused 0 (delta 0)
    remote:
    remote: To create a merge request for ?feature/switch_db_app_res, visit:
    remote: ? http://git.dev.wochanye.com/gateway/thrall-user/-/merge_requests/new?merge_request%5Bsource_branch%5D=%C2%A0feature%2Fswitch_db_app_res
    remote:
    To http://git.dev.wochanye.com/gateway/thrall-user.git
    ?* [new branch] ? ? ??feature/switch_db_app_res -> ?feature/switch_db_app_res
    Branch '?feature/switch_db_app_res' set up to track remote branch '?feature/switch_db_app_res' from 'origin'.

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git push origin feature/switch_db_app_res
    error: src refspec feature/switch_db_app_res does not match any
    error: failed to push some refs to 'http://git.dev.wochanye.com/gateway/thrall-user.git'

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git push
    Everything up-to-date

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git push origin feature/switch_db_app_res
    error: src refspec feature/switch_db_app_res does not match any
    error: failed to push some refs to 'http://git.dev.wochanye.com/gateway/thrall-user.git'

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git pull
    Already up to date.

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git status
    On branch ?feature/switch_db_app_res
    Your branch is up to date with 'origin/?feature/switch_db_app_res'.

    nothing to commit, working tree clean

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git pull
    Already up to date.

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git push
    Everything up-to-date

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git branch
    ? feature/switch_db
    ? master
    * ?feature/switch_db_app_res

    Administrator@PC-201908221240 MINGW64 /c/workspace/idea/unicom/saas/app_resource_newbranch/thrall-user (?feature/switch_db_app_res)
    $ git branch -r
    ? origin/HEAD -> origin/master
    ? origin/feature/switch_db
    ? origin/feature/upgrade_ci
    ? origin/hotfix/auth_call_http
    ? origin/master
    ? origin/multi_data_source
    ? origin/?feature/switch_db_app_res

    ?
    ?

    總結(jié)

    以上是生活随笔為你收集整理的git删除本地分支、删除远程分支 复制分支的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。