Renaming Git Branch

Follow the steps below to rename a Local and Remote Git Branch:

01 Start by switching to the local branch which you want to rename:

git checkout <old_name>

02 Rename the local branch by typing:

git branch -m <new_name>

  

03. Push the <new_name> local branch and reset the upstream branch:

git push origin -u <new_name>

 

04. Delete the <old_name> remote branch:

git push origin --delete <old_name>

 

来源: https://linuxize.com/post/how-to-rename-local-and-remote-git-branch/

Rename a Local and Remote Git Branch的更多相关文章

  1. Rename a local and remote branch in git

    If you have named a branch incorrectly AND pushed this to the remote repository follow these steps b ...

  2. git branch & git remote branch

    git branch & git remote branch $ git branch -h usage: git branch [<options>] [-r | -a] [-- ...

  3. 【IDEA】 Can't Update No tracked branch configured for branch master or the branch doesn't exist. To make your branch track a remote branch call, for example, git branch --set-upstream-to origin/master

    IDEA点击GIT更新按钮时,报错如下: Can't UpdateNo tracked branch configured for branch master or the branch doesn' ...

  4. git远程删除分支后,本地git branch -a 依然能看到的解决办法

    http://blog.csdn.net/qq_16885135/article/details/52777871 使用 git branch -a 命令可以查http://blog.csdn.net ...

  5. git branch 分支管理

    在多人协作的情况下,master通常是稳定的分支.可以再建一些"develop","testing"等名称的分支.主管master的人做开发的话最好也建立自己的 ...

  6. Git: Setup a remote Git repository

    o setup a folder on a server which service for remote Git repository, apply the following steps: Cre ...

  7. git 使用详解(9)-- 分支的新建与合并 git branch -d、merge、 --merged/--no-merged/-v

    现在让我们来看一个简单的分支与合并的例子,实际工作中大体也会用到这样的工作流程: 开发某个网站. 为实现某个新的需求,创建一个分支. 在这个分支上开展工作. 假设此时,你突然接到一个电话说有个很严重的 ...

  8. git远程删除分支后,本地执行git branch -a依然能看到删除分支到底该咋整?

    使用命令git branch -a可以查看所有本地分支和远程分支(git branch -r 可以只查看远程分支) 如果发现很多在远程仓库已经删除的分支在本地依然可以看到到底该怎么办呢?(反正强迫症受 ...

  9. [git]git的基本原理|git branch|git

    继续写一篇git的文章,介绍下git的历史和基本原理. 介绍下git的历史,据砖家考究,遥想当年,linux的创始人,牛人李纳斯,开发linux用的版本控制工具BitKeeper,出于公益或友好, 是 ...

  10. git branch --set-upstream-to=

    test@uat:/usr/server/app_server# git config --local -lcore.repositoryformatversion=0core.filemode=tr ...

随机推荐

  1. android HttpURLConnection ,HttpClient设置Cookie

    上一阶段项目设计使用cookie信息实现登录访问功能,在实现过程遇到一些问题,下面整理一下: 首先,client想使用cookie,必须访问一次server从会话中获取cookie信息,然后在设置回去 ...

  2. Winform使用CefSharp和HttpWebRequest如何保持会话Session

    之前我们使用CefSharp,在Winform中,使用ChromiumWebBrowser加载了web项目的页面.并且通过html页面的js调用了本地的窗口.那么下一个问题来了.为了保障系统安全性,项 ...

  3. java第五周学习情况

    这个星期主要是在读<大道至简>这本书,话说这本书确实还行啊.看完之后懂得了很多东西,前天写了一篇读后感,把自己的感想记了下来,以后有机会可以再看一遍.然后就是一些Java的相关知识了.也没 ...

  4. Android-AccessibilityService

    概述 AccessibilityService用于提供辅助功能服务,其在后台运行,并在触发AccessibilityEvents时由系统接收回调.此类事件表示用户界面中的某些状态转换,例如,焦点更改, ...

  5. php基础教程(一)

    语法: PHP的语法很简单 --直接看代码: <?php /*代码部分*/ ?> 这就是PHP代码的声明方式. 注:<? ?> 等这中写法也可以写,但是不建议这么写. 标记语句 ...

  6. Oracle修改查询优化器版本

    查询优化器参数optimizer_features_enable 在每个数据库版本中,Oracle都会在查询优化器中引入或启用新的特性. 如果在升级到一个新的版本后希望保留查询优化器的行为,可以通过设 ...

  7. Linux基础第七章:磁盘阵列(RAID)

    一.磁盘阵列 二.磁盘阵列类型 1.RAID 0 2.RAID 1 3.RAID 5 4.RAID10 三.磁盘阵列配置 1.硬件方式 2.软件方式 一.磁盘阵列独立硬盘冗余阵列(RAID, Redu ...

  8. bean实例化三种方式

    实例化bean的方式有三种,如下: 1.无参构造方法实例化 2.工厂静态方法实例化 3.工厂普通方法实例化 此处演示的项目结构如下: 方法一:无参构造方法实例化(注意,该类中不能存在有参构造函数) U ...

  9. 训练题——DS18B20部分

    Author:Cherry_Ywj 0. 前言 本文档以 DS18B20 为例,主要介绍如何针对一种传感器编写相应的驱动库,驱动是单片机开发中难度较大的一环.从看别人代码并对照 datasheet 开 ...

  10. Unity中实现在规定时间内从一个值递增到另一个值

    1.进度条(在规定时间内完成进度条) private Image progressBar; private float currentProgress = 0; /// <summary> ...