首页 > 其他分享 >How to Delete a Git Branch Both Locally and Remotely

How to Delete a Git Branch Both Locally and Remotely

时间:2023-05-23 16:34:19浏览次数:46  
标签:Both Git Locally git branch 033 delete

TL;DR version

https://www.freecodecamp.org/news/how-to-delete-a-git-branch-both-locally-and-remotely/

// delete branch locally
git branch -d localBranchName

// delete branch remotely
git push origin --delete remoteBranchName

# To Make Linux show user@host(HH:MM:SS):/your-current-path$
// vi ~/.bashrc
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\](\D{%H:%M:%S})\[\033[01;34m\]:$PWD\[\033[00m\]\$ '

标签:Both,Git,Locally,git,branch,033,delete
From: https://www.cnblogs.com/chenjo/p/17425607.html

相关文章

  • Git如何同步多个远程仓库
      Git如何同步多个远程仓库 https://blog.csdn.net/L_Y_Fei/article/details/108406927 cdexisting_repogitremoterenameoriginold-origingitremoteaddoriginhttp://xx.xx.xx.xx/xx.gitgitpush-uorigin--allgitpush-uorigin--tagsgitpush-uorigin......
  • 源代码管理工具GitHub介绍
    GitHub是一个基于Web的Git代码托管平台,该平台提供的服务包括代码托管、代码审查、协作、项目管理等,旨在帮助开发者更加方便地进行软件开发和协作。下面主要从GitHub主要页面功能和如何利用GitHub辅助完成团队项目两个方面进行简单的介绍。1.Git和GitHubGit和GitHub是两个东......
  • git pull --rebase
    为了避免git自动合并代码并且提交无意义记录,使用:gitpull--rebase来拉取远端代码,也可以一劳永逸:gitconfig--globalpull.rebasetrue但需要注意,当本地有未提交的代码时,使用gitpull--rebase会报错Cannotrebase:YouhaveunstagedchangesPleasecommitorstash......
  • Git的下载安装配置
     git教程 1.版本管理工具概念我在大学毕业写论文的时候的时候碰到过如下的现象```<<毕业论文第一版.doc>><<毕业论文第二版.doc>><<毕业论文第三版.doc>><<毕业论文最终版.doc>><<毕业论文最终版2.doc>>```在这种情况下如果不能查看修改之前的代码,查找问题是非常困难的......
  • git 自己写的使用方法
    QuicksetuporHTTPSSSHWerecommendeveryrepositoryincludea README, LICENSE,and .gitignore.…orcreateanewrepositoryonthecommandlineecho"#Demo">>README.mdgitinitgitaddREADME.......
  • Mac Git安装
    如何安装Git到MACOSX一,使用Gitcommand-line这里先介绍下使用Command-line。1,下载Gitinstaller,地址;http://git-scm.com/downloads2,下载之后打开,双击.pkg安装3,打开终端,使用git--version命令查看安装版本,有就是安装成功了......
  • git 学习网页
    git学习网页:http://backlogtool.com/git-guide/cn/intro/intro1_1.htmlhttp://git-scm.com/book/zh/v2......
  • Git强行替换覆盖master分支(转)
    应用场景说明:在开发中,通常会保持一个主分支master,及多个dev分支,但是因为dev分支的开发周期过长,迭代太多而没有及时维护master,导致后来发版上线的大部分代码都在dev分支上,如果将代码在master分支合并会导致很多冲突,最后想丢弃原始master分支上的代码,直接将已经测试确......
  • vs git 分支缓存问题
    我们项目不停的开发,就会产生很多本地分支,但实际上git服务器上早就合并了,没有这么多分支,但VisualStudioGit分支本地一大堆,手动一个个删除太费时间。使用如下两条命令可以切换VisualStudioGit分支以git服务器上的分支为主,本地不做缓存。cmd或者gitbash直接执行gitconfig--g......
  • Git拉取代码报错:Can't Update No tracked branch configured for branch dev or the b
    错误: 解决方法:第一步:gitpullorigin(远程仓库名称)develop(远程分支名称)--allow-unrelated-histories第二步:gitbranch--set-upstream-toorigin(远程仓库名称)/develop(远程分支名称)dev(本地分支名称)显示如下则为成功,可正常拉取代码 ......