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. C语言学习--指针数组

    #include<stdio.h> //指针数组, 数组里面的每一个元素都是指针 int main() { int a = 10; int b = 20; int c = 30; // i ...

  2. WebAPI :Get、Post、Delete、Put

    public class RestClientMethod { /// <summary> /// 请求服务器地址 /// </summary> public string B ...

  3. VUE2.0 脚手架搭建项目,如何配置本地IP地址访问项目,详解

    1.首先找到config文件夹目录下的 index.js文件 // Various Dev Server settings //host: 'localhost' //将localhost进行替换成 ...

  4. 2022-3-11内部群每日三题-清辉PMP

    1.供应商通知项目经理可能延迟交付一个模块.项目经理应该怎么做? A.立即通知相关方. B.通过增加额外的天数来修改项目管理计划,并记录它们对项目时间的影响. C.审查风险管理计划以评估风险,然后通知 ...

  5. 几个Shell脚本的例子

    [例子:001]判断输入为数字,字符或其他 #!/bin/bash read -p "Enter a number or string here:" input case $inp ...

  6. spider_object_01使用正则爬取百度贴吧所有内容保存成html

    """本案例不涉及数据提取,仅指导 网页分页爬取的两种方式 思路非第一种:利用while Ture,传参,然后在设定一个判断条件,案例中用的是如果找不到下一页,循环退出( ...

  7. C++ OnlineJudge

    基本输入输出 1.接收多行数据,直到文件末尾 1 #include <iostream> 2 //#include <bits/stdc++.h> 3 #include < ...

  8. DHCP 服务详解

    本文转发于华为IP知识百科,链接地址 DHCP 目录 一.什么是DHCP? 二.为什么要使用DHCP? 三.DHCP是怎么工作的 四.DHCP使用场景 一.什么是DHCP? 动态主机配置协议DHCP( ...

  9. vite+vue3批量导入静态资源图片;动态绑定大量图片

    vite版本:vite3:vue版本:vue3 打包上线后发现,动态绑定的图片皆失效. 单图可用 import 导入解决,但是若有大量图片,一一导入则耗时耗力. vue2+webpack 可用 req ...

  10. MYSQL面试题大汇总

    1.数据库的三大范式是什么 1)列不可再分 2)行可以唯一区分 3)表的非主属性不可以依赖与其他表的非主属性,外键约束 2.数据库中的事务 1)什么是事务:多条sql语句,要么都成功,要么都失败 2) ...