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

git删除本地分支、删除远程分支 复制分支相关推荐

  1. 使用git在本地电脑与远程GitHub/gitlub库中clone别人的github上的远程仓库代码,找资源

    使用git在本地电脑与远程GitHub/gitlub库中clone别人的github上的远程仓库代码,找资源 1.在自己电脑创建本地仓库 先下载个Git 打开git bash,找一个存放所有git项目 ...

  2. git删除本地tag和远程tag

    以tag test为例,这个tag已经同步到远程,但是现在发现了一个问题,需要撤回该tag,git命令如下: 删除本地tag: git tag -d test 删除远程tag: git push or ...

  3. Git详解之必知点----Git、本地仓库、远程仓库、IDEA集成Git

    Git详解之必知点 1.Git介绍 1.1版本控制(理解) 1.2开发中存在的问题(理解) 1.3SVN版本控制(理解) 1.4Git版本控制(理解) 2.Git下载和安装 2.1Git的安装(应用) ...

  4. 使用Git将本地仓库与远程仓库关联的三种方式

    前提条件: Git已经配置完,能实现Push,Pull.Clone等操作 GitHub/Gitee已经添加了SSH Keys 没有配置好的参考这篇文章:是的是的 一.通过Clone远程仓库的方式 前提 ...

  5. git 创建本地仓库、远程仓库,上传项目

    1.在本地想创建git仓库的地方创建本地仓库 首先右键打开 Git Bash Here,如果没有,请先安装git,下载地址:https://git-scm.com/downloads git init ...

  6. git初始化本地仓库,远程提交远端代码教程

    首先进入代码仓库目录:执行git init 在github创建仓库,建立README文件 本地仓库与远程仓库建立连接本地仓库添加了github上的git仓库作为远程仓库,起名origingit rem ...

  7. 使用git 实现本地文件和远程代码仓的互相同步

    一.关于Git的安装与配置,可以参考这两篇文章 Git 详细安装教程(详解 Git 安装过程的每一个步骤) GitHub的安装与配置 二.同步本地文件与代码仓常规流程 1.在github上创建项目2. ...

  8. git 001--建本地仓库和远程仓库和拉代码

    要使用Git对我们的代码进行管理,首先需要获得Git仓库. 获取Git仓库通常有两种方式: 在本地初始化Git仓库(不常用) 从远程仓库克隆(常用) 一.建本地仓库 方法一: 在自己电脑的任意目录下创 ...

  9. git修改本地仓库和远程仓库名称

    修改远程仓库名称 GitHub上进入要修改的仓库,找到settings,修改名称. 修改本地仓库名称 本地仓库没有名称进入本地代码位置执行 mv mygit 新的目录 本地仓库和远程仓库关联 cd 本 ...

  10. 08 Git中本地工作与远程仓库的同步

    本节视频: 本节的目标对应日常工作的常态,将应对第一次提交中不会遇到的各种"意外".这些意外是多人合作中的正常现象,需要掌握其正确的处理方式. 与上一节相比,本节的新内容是从远程仓 ...

最新文章

  1. Java前端控制器模式
  2. StoreFront 2.5让XenDesktop和XenApp如虎添翼
  3. python小白逆袭大神课程心得_Python小白逆袭大神学习心得
  4. 为什么整数在python中表示d_python 数据类型和变量
  5. 无锁数据结构三:无锁数据结构的两大问题
  6. 上架相关——App Store 上架流程
  7. 软件架构师的12项修炼--软技能篇
  8. 加密芯片——RSA算法特点与应用注意事项
  9. kafka session.timeout.ms 是指消费一条数据的时间?_干货 | Kafka 内核知识梳理,附思维导图...
  10. GB28181协议--GB28181协议简介
  11. TMDB 5000电影数据集
  12. python反爬虫策略ppt_关于反爬虫策略
  13. PHP合并两张(多张)图片
  14. 微信支付接入-弹出支付框输入密码后一直在转圈,20s后提示:支付失败,请稍后再试
  15. Java发送短信验证码
  16. wxwidget编译安装_linux下编译安装wxWidgets-2.8.12和audacity-2.0.3教程
  17. java面向对象编程思想的理解
  18. 读写shp等空间数据,进行geometry、SimpleFeature等转换的工具类
  19. springboot文件上传、下载使用ftp工具将文件上传至服务器
  20. 计算机内存满了怎么清理,电脑内存满了怎么清理

热门文章

  1. 导数卷积 (NTT)
  2. [51 nod 1238] 最小公倍数之和 V3(杜教筛)
  3. 【BZOJ3328】PYXFIB【矩阵快速幂】【单位根反演】【二项式定理】
  4. ARC078F - Mole and Abandoned Mine(状压DP)
  5. cf1523B. Lord of the Values
  6. Bob‘s Problem
  7. 洛谷P3607:Subsequence Reversal P(区间dp)
  8. AT2161-[ARC065D]シャッフル/Shuffling【dp】
  9. nssl1454-最短路【并查集,贪心】
  10. P3629-[APIO2010]巡逻【树的直径】