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. Python生成whl文件

    下载源码包,生成whl文件 python setup.py bdist_wheel

  2. Dashboard是什么意思 Dashboard怎么用?

    Dashboard是什么意思?Dashboard怎么用?可能很多Mac用户朋友都不知道,Dashboard是苹果OS X操作系统的一大特色.是随苹果公司 Mac OS X 10.4 Tiger 操作系 ...

  3. 简易FTP

    老男孩----上海校区 简易FTP 客户端端 import socket import struct import json import os class MYTCPCLIENT: address_ ...

  4. 【SSO单点系列】(2):CAS4.0 之 跨域 Ajax 登录实践

    CAS4.0 之 跨域 Ajax 登录实践 一.问题描述 CAS实现单点 实现一处登录 可访问多个应用 . 但是原登录是CAS默认登录页面和登出页面是无法重定向到自定义页面的   此处使用Ajax+I ...

  5. HCIA-ICT实战基础07-访问控制列表ACL进阶

    HCIA-ICT实战基础-访问控制列表ACL进阶 目录 二层ACL技术及配置 高级ACL的扩展使用方法及使用场景 1 二层ACL技术及配置 1.1 二层ACL概念 使用报文的以太网帧头来定义规则, 根 ...

  6. 在SQLServer中将数据从高版本导入低版本的方法

    一般的软件都是向下兼容的,高版本通常都是可以兼容低版本.但是如果想将高版本数据库中的数据导入到低版本中,直接采用常规的备份还原或是分离附加操作就会因为结构不同而报错. 要想实现数据从高版本到低版本,除 ...

  7. HDK_节点开发:SOP_ComputeVisibility

    Houdini版本:18.5.596 节点概述:剔除模型在某视线方向下所有不可见面. 参数界面: 输入:三角化的模型(左),可选输入遮挡模型(右) 原理:在画布上绘制该方向上的最近深度,作为判定各面可 ...

  8. 20202411 2020-2021-2 《Python程序设计》实验一报告

    20202411 2020-2021-2 <Python程序设计>实验一报告 课程:<Python程序设计> 班级: 2024 姓名: 陈书桓 学号:20202411 实验教师 ...

  9. UTT艾泰路由器默认口令(admin/admin)

    网络空间资产搜索: 登陆弱口令:admin/****** 登陆成功 End!!!

  10. Java下 BigDecimal类型数值的计算(转)

    BigDecimal bignum1 = new BigDecimal("40"); BigDecimal bignum2 = new BigDecimal("7&quo ...