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. 创建SFTP用户并指定访问目录 Linux

    1.创建登录用户及用户组   --可以根据自身磁盘挂载情况制定用户home目录 -d 选项 groupadd test1mkdir -p /data/test1 useradd test1 -g te ...

  2. IDEA中已配置阿里镜像,但maven无法下载jar包的问题

    然后我还出现了一个问题,由于使用了HTTPS,存在着SSL证书验证的问题,因此我在IDEA中添加了一行配置: 配置如下: -Dmaven.wagon.http.ssl.insecure=true -D ...

  3. 【音视频】Qt中引入FFmpeg

    音视频有关的部分都是使用标准C++的,只有界面的部分才会使用Qt的内容.这样也是为了方便以后移植到其他系统上. 音视频开发中最常做的就是编解码的操作.以H.264为例:如果想要自己实现编码h.264, ...

  4. git使用采坑-The project you were looking for could not be found 解决方式

    清除本地git账户,重新输入用户名密码(最优) git config --system --unset credential.helper之后再进行git操作时,弹出用户名密码窗口,输入即可 详情如下 ...

  5. CSS3-animation实现走马灯效果

    动画animation 1.先定义动画: @keyframes 动画名称( from{} to{} ) 或者 @keyframes 动画名称( 0%{} 50%{} 100%{} ) 百分号指的是动画 ...

  6. R7800 2.4G webshell

    webshell执行 iwpriv ath1 disablecoext 1

  7. 第三章:用python实现常用的用户分层模型(RFM模型)

    文章目录 项目背景 读取数据 数据分析 分析 Recent 分析 Frequency 分析 Mount RFM模型 分位数分层 自定义分层 定义客户标签 数据可视化 结论 源码地址 本文可以学习到以下 ...

  8. 利用expect交互批量修改普通用户过期密码

    利用expect交互批量修改普通用户过期密码 因为公司接了一个密码托管的活,有10000多台机器,系统有 openSUSE,SUSE,Ubuntu,centos,Oracle-Linux, 而且什么版 ...

  9. Mybatis框架中 collection 标签 和 association标签中关于 columnPrefix 属性的底层逻辑

    columnPrefix的作用是给column自动拼接上前缀, 已知多重嵌套的collection 和 association的columnPrefix属性的值是会叠加的 <associatio ...

  10. lvds接口

    1.lvds就是差分信号接口,tft-lcd屏幕,一种常用的接口. 2.有3种标准,18bit, 24bit(JEIDA) 与 24bit(VESA) 详细看https://www.topwaydis ...