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

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

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

展开

 

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

  1. 1、查看所有分支

  2. git branch -a

  3. 2、查看当前所在分支

  4. git branch

  5. 3、删除本地的bug_xzx分支

  6. git branch -d bug_xzx

  7. 4、删除远程的bug_xzx分支

  8. git push origin --delete bug_xzx

推荐大家一个好用的git分支管理工具SourceTree,如下图所示可以直接从远程拉取分支到本地,并且可视化对分支进行操作

 

 

 

 

 

 

git —— 将当前分支复制到新建分支

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

当前分支:i-health   新分支:i-health-noTab

1. 当前分支:i-health

从当前分支copy开发分支
git checkout -b i-health-noTab

运行,此时当前分支变为 i-health-noTab


2. 把新建的分支push到远端
git push origin  i-health-noTab

 

3。 将分支与远端关联 

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

 

4.拉取代码成功

git pull
————————————————
版权声明:本文为CSDN博主「一闪一闪亮晶晶,漫天都是小星星」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接: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     上面的命令不行这个就好了  推的就是当前分支
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

 
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值