首页 > 其他分享 >Rename a Local and Remote Git Branch

Rename a Local and Remote Git Branch

时间:2022-11-16 17:12:01浏览次数:39  
标签:Rename rename git Remote branch Git Branch local

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,rename,git,Remote,branch,Git,Branch,local
From: https://www.cnblogs.com/wgDream/p/16896561.html

相关文章

  • vscode提交git自动格式化的问题
    最近不是在写新项目嘛,发现提交git之后总会有大批的代码变动,而且只是单纯的格式化,这根本没必要,还会妨碍我看我的代码变化,今天有时间了处理一下就是类似这样的代码,在上传git......
  • git 分支合并到master,将分支所有提交汇总为一次提交
    当有一个新的功能需要开发时,我们一般需要从master新建一个功能开发分支,如果这个功能需要的开发周期超过一天,我们一般都会留下多次commit提交。当功能开发并测试完毕,需要合......
  • GIT-LFS(解决大于100M的文件无法上传的问题)
    1.什么是GIT-LFSGitLFS(LargeFileStorage)是一个开源的Git大文件版本控制的解决方案和工具集,工具自身是基于Golang进行实现,并在Github上开源。原理上是通过对Git客户......
  • gitlab 部署与钉钉集成
    gitlab部署与钉钉集成gitlab部署此处展示docker部署gitlabdockerrun\--hostname192.168.49.1\#192.168.49.1为自己局域网的ip--publish7001:44......
  • git 分支指令
    如果想克隆某个分支gitclone''-bbranchname 查看本地所有分支gitbranch 查看所在目录的分支gitbranch-a 查看远程所有分支gitbranch-r 删除某分......
  • Github的基本功能教程_F_hawk189_新浪博客
    今天在知乎上看到的一个介绍,虽然不是特比详细,但是生动易懂,看完之后,大概就知道怎么用了Repository:你和我一起做“知乎首页”,“知乎首页”就是Repository,即项目或者”未......
  • Python - request 报错:raise RemoteDisconnected("Remote end closed connection with
    2022-11-1521:46:20,261INFO[get_data.py(get_product_mode:46)]-当前page======>:255Traceback(mostrecentcalllast):File"D:\jlc_auto_test\fa_search_tes......
  • windows操作系统配置github的SSH免密登录
    一、生成ssh秘钥前提条件:安装OpenSSH进入用户家目录,打开cmd终端输入ssh-keygen,一路回车生成终端输入命令typeid_rsa.pub查看公钥内容并复制内容二、将复制的公钥内容......
  • 使用 Git 代理来解决 GitHub git 443: Timed out的报错
    由于GitHub目前在国内半墙不墙的状态,我们在从GitHub上push或者pull都很容易卡住甚至出现git443:Timedout的报错。报错如下Failedtoconnecttogithub.com......
  • 04.github仓库远程更新时遇到的问题
    常见的错误报错内容基本都是error:failedtopushsomerefsto‘远程仓库地址’。导致产生原因我们想把自己本地的某个项目关联到远程仓库并推送上去操作  本地项......