git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote

注:红色为标注!不需要键入!

欢迎加入前端交流群交流知识获取视频资料:

git-更改本地和远程分支的名称的更多相关文章

  1. git删除本地及远程分支

    1. 删除本地分支: git branch -d branchName 2. 删除远程分支: // 方法一:将删除的本地分支推到远程(要删除的远程分支在本地有映射) git push origin : ...

  2. git设置本地与远程分支关联

    1.为了避免每次都进行验证,在git进行绑定ssh mkdir ~/.ssh ssh-keygen -t rsa -C "xxx@qq.com" 将生成的公钥粘贴到git中 2.本 ...

  3. git 使用命令删除远程分支和本地分支

    删除远程分支命令: git push origin   :<远程分支名称> git push origin --delete <远程分支名称> 删除本地分支: git bran ...

  4. git branch --set-upstream 本地关联远程分支

    最近使用git pull的时候多次碰见下面的情况: There is no tracking information for the current branch.Please specify whi ...

  5. git本地与远程分支

    已经有远程分支,在本地检出,并且关联到远程分支 git checkout --trach origin/远程分支名 git checkout -b 本地分支名  origin/远程分支名 $ git ...

  6. git 强推本地分支覆盖远程分支

    git 强推本地分支覆盖远程分支git push origin 分支名 --force

  7. git branch --set-upstream-to 本地关联远程分支

    最近使用git pull的时候多次碰见下面的情况: There is no tracking information for the current branch. Please specify wh ...

  8. git创建和删除远程分支

    问题描述:           使用git创建和删除远程分支 问题解决:              (1)git创建本地分支 注:            如上所示,使用命令 git branch -a ...

  9. 使用git连接本地和远程github

    使用git连接本地和远程github 网上很多github的流程比较乱,自己尝试整理了一下,主要是步骤较为清晰,如果有不清楚的可详细进行搜索对比 1. 申请和设置github https://gith ...

随机推荐

  1. 【转载】原 IntelliJ IDEA (idea)引入eclipse web项目

    原文地址:http://my.oschina.net/u/1170781/blog/192731 摘要 概述IntelliJ IDEA,以后都简称为idea,鼓捣了很久,看了很多例子才搞出来,希望对其 ...

  2. flipt 一个基于golang 的特性工具开发类库

    以前介绍过一个Flagr 的基于golang 的特性功能开发类库(技术雷达推荐),今天看到一个类似也很不错的方案flipt 参考架构 包含的特性 快速,使用golang 编写,同时进行了性能优化 运行 ...

  3. jenkins自动部署测试环境

    构建脚本如下: echo "当前目录":$(pwd)echo "当前时间":$(date +%Y-%m-%d_%H:%M)find ./ -type f -na ...

  4. 【原】Mysql存储关联数组

    $fruits= array("apple" => "苹果", "banana" => "香蕉"," ...

  5. 解决docker容器启动时候无法映射端口的问题

    当我们停止防火墙后,docker容器启动映射端口可能无法映射端口,这个时候需要重建docker0网桥. 详细的错误是这样的: docker: Error response from daemon: d ...

  6. UVA - 11536 Smallest Sub-Array(尺取法)

    题目: 思路: 读完题之后第一时间想到的是尺取法来做这个题,结果让自己写写崩了,还是练得少!! 到网上搜了一下学习了大佬的标记方法,用一个变量来判断是不是都已经出现,要比每次都判断一下快超多. 代码: ...

  7. virtualenv与virtualenvwrapper

    一.Linux下安装.配置virtualenv pip3 install virtualenv # 创建虚拟环境env1 virtualenv env1 --no-site-packages --py ...

  8. 2.js原型的基本概念

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. hammerjs & Swiper & touch & gesture

    hammerjs https://hammerjs.github.io/getting-started/ http://hammerjs.github.io/recognizer-swipe/ Swi ...

  10. HDU 4923 (贪心+证明)

    Room and Moor Problem Description PM Room defines a sequence A = {A1, A2,..., AN}, each of which is ...