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

 
 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/327647.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

kotlin能用嵌入式linux,Kotlin在项目中的应用和踩过的坑

应用空类型安全Kotlin引入了可空类型(用?标识),在编译期杜绝了可空类型直接调用方法的可能。var a: String "abc"a null // 编译错误var b: String? "abc"b null // okval l a.lengthval l b.length // 错误:变量…

ASP.NET Core的Kestrel服务器

Kestrel是一个基于libuv的跨平台ASP.NET Core web服务器,libuv是一个跨平台的异步I/O库。ASP.NET Core模板项目使用Kestrel作为默认的web服务器。 Kestrel支持以下功能: HTTPS用于启用不透明升级的WebSockets位于Nginx之后的高性能Unix sockets Kestrel …

RandomAccessFile

转载自 RandomAccessFile RandomAccessFile是用来访问那些保存数据记录的文件的,你就可以用seek( )方法来访问记录,并进行读写了。这些记录的大小不必相同;但是其大小和位置必须是可知的。但是该类仅限于操作文件。 RandomAccessFile不属于I…

JSR303常见参数

常见参数 NotNull(message "名字不能为空")private String userName;Max(value 120, message "年龄最大不能查过120")private int age;Email(message "邮箱格式错误")private String email;空检查Null 验证对象是否为nullNotNull 验证对象是…

解决:Could not find metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml in loc

我的方法 1.电脑可以Google 你要开启那个小飞机 2.笔记本连接手机热点 3.重新操作秒下下来 总结: 公司的网太差 , 也有可能做了外网访问的限制 下面是一个大神的方法 https://blog.csdn.net/Ajax_mt/article/details/81870086 解决:Could n…

Linux 临时表空间满了,Temporary表空间100%解决方案

说明:temp表空间的TS# 为 3*, So TS# 1 4一下是摘自Metalink的说明The DROP_SEGMENTS event~~~~~~~~~~~~~~~~~~~~~~~Available from 8.0 onwards.DESCRIPTIONFinds all the temporary segments in a tablespace which are notcurrently locked and drops them.For t…

Ajax传递json数据

Ajax的传递json数据的实现&#xff1a; 看这篇之前建议大家去看看前面两篇文章&#xff1a; 1.Ajax基本案例详解之$.ajax的实现 2.Ajax基本案例详解之$.get的实现 现在来看一下具体的内容&#xff0c;在index.jsp的<script>里面写&#xff1a; $.ajax({url:"…

ASP.NET Core服务器综述

ASP.NET Core应用通过一个进程内的HTTP服务器实例实现运行&#xff0c;这个服务器实例侦听HTTP请求并将请求作为组成HttpContext的一组请求功能集暴露给我们的应用程序。 ASP.NET Core搭载两个服务器实现&#xff1a; Kestrel是一个基于libuv的跨平台HTTP服务器&#xff0c;lib…

多环境切换---SpringBoot

多环境切换 优先级由高到底&#xff0c;高优先级的配置会覆盖低优先级的配置&#xff1b; profile是Spring对不同环境提供不同配置功能的支持&#xff0c;可以通过激活不同的环境版本&#xff0c;实现快速切换环境&#xff1b; [外链图片转存失败,源站可能有防盗链机制,建议…

Java.io.File.getPath()方法实例

转载自 Java.io.File.getPath()方法实例 java.io.File.getPath() 方法将抽象路径名到路径名字符串。为了分离名称的序列所产生的字符串使用默认名称分隔符。 声明 以下是java.io.File.getPath()方法的声明&#xff1a; public String getPath() String getPath() 参数 NA …

linux中usb设备名,Linux 中识别 USB 设备名字的 4 种方法

摘要&#xff1a; 对于初学者来说&#xff0c;在 Linux 系统里你必须掌握的技术之一就是识别出插入系统里的各种设备。这也许是你的系统硬盘、外部的存储设备或者是可移动设备&#xff0c;比如 USB 设备或 SD 闪存卡等。 现如今&#xff0c;使用 USB 设备来传输文件是十分常见的…

作为 IT 行业的过来人,你有什么话想对后辈说的?

程序员转型 作为 IT 行业的过来人&#xff0c;你有什么话想对后辈说的&#xff1f; - 圆胖肿的回答 - 知乎 https://www.zhihu.com/question/312019918/answer/1246349365 圆胖肿 程序猿 1,644 人赞同了该回答 给资本家做工具人不靠谱&#xff0c;迟早被卷 如果你是男…

探究Java File类中list()、listFiles()的使用及区别,认识和使用匿名内部类

转载自 探究Java File类中list()、listFiles()的使用及区别&#xff0c;认识和使用匿名内部类 内容概要&#xff1a; 1、认识File类&#xff1b; 2、File的构造函数&#xff1b; 3、list()及其重载方法的使用&#xff0c;匿名内部类的两种使用方式&#xff1b; 4、list…

自动配置原理---SpringBoot

自动配置原理 配置文件到底能写什么&#xff1f;怎么写&#xff1f; SpringBoot官方文档中有大量的配置&#xff0c;我们无法全部记住 分析自动配置原理 我们以**HttpEncodingAutoConfiguration&#xff08;Http编码自动配置&#xff09;**为例解释自动配置原理&#xff1b;…

Docker 部署dotnetcore

安装docker 系统还是之前centos 7.1 https://www.docker.com/products/docker#/linux yum update 创建源: /etc/yum.repos.d/docker.repo tee /etc/yum.repos.d/docker.repo <<-EOF [dockerrepo] nameDocker Repository baseurlhttps://yum.dockerproject.org/repo/main/…

Ajax基本案例详解之$.getjson的实现

Ajax的$.gethson实现&#xff1a; 看这篇之前建议大家去看看前面两篇文章&#xff1a; 1.Ajax基本案例详解之$.ajax的实现 2.Ajax基本案例详解之$.get的实现 现在写一下$.getjson里面的主要内容&#xff1a; $.getJSON("doindex.jsp",{email:$("#email&q…

Python基础案例(一)

早就有耳闻Python是多么多么的强大了&#xff0c;满怀一颗好奇心去研究研究&#xff0c;初学几天&#xff0c;果然不出所料&#xff0c;Python很强大&#xff0c;相对java,C# 等来说也比较简单&#xff0c;于是在学习中做了点总结&#xff0c;欢迎评论区留言&#xff0c;互相交…

虚拟机安装windows ghost版本系统记录完整过程

重点 1.磁盘一定要分成2个 2.直接安装第一个盘 就是进入CD后选1 自动安装 https://blog.csdn.net/hanzl1/article/details/79298787 虚拟机安装windows ghost版本系统记录完整过程 NO如果 2018-02-09 15:26:08 15193 收藏 5 分类专栏&#xff1a; windows 虚拟机 版权 …

linux下kill指令默认信号,Linux基础命令之kill命令

相信大家在使用Linux的过程中都会遇到过某个程序出错导致系统锁死的情况&#xff0c;按照常规的思维我们会通过重启来重新启动系统。然而事实上在Linux中并不需要进行重启就能够完成出错程序的关闭操作。在Linux中我们可以通过使用"kill"命令来强制终结它。那么到底它…

java中File类的getPath(),getAbsolutePath(),getCanonicalPath()区别

转载自 java中File类的getPath(),getAbsolutePath(),getCanonicalPath()区别 今天看一个例子&#xff0c;里面用到File类的getCanonicalPath()方法&#xff0c;忽然忘记这个方法返回的是什么样的路径了&#xff0c;跟getPath()和getAbsolutePath()有什么区别&#xff1f;带着这…