Git: delete all branches without upstream
Git all delete Without upstream
2023-09-11 14:16:15 时间
#!/usr/bin/env bash # delete all branches without upstream while read branch; do upstream=$(git rev-parse --abbrev-ref $branch@{upstream} 2>/dev/null) if [[ $? == 0 ]]; then # upstream exists echo $branch tracks $upstream else # no upstream --> delete git branch -d $branch fi done < <(git for-each-ref --format='%(refname:short)' refs/heads)
相关文章
- Git基础笔记(便查阅)
- PyCharm配置 Git 教程
- [Git] git merge之squash
- [Git] git merge和rebase的区别
- git的常用命令
- [git/svn]Git和SVN差异
- 终于解决“Git Windows客户端保存用户名与密码”的问题(转载)
- [Git] A better git process
- [Git] Recover Local Changes from `git reset --hard` with `git reflog`
- [Practical Git] Diagnose which commit broke something with git bisect
- [Practical Git] Filter commit history with git log arguments
- 详解Git工作区、暂存区、历史记录区以及git reset、git revert、git checkout等撤销命令的区别
- Git远程04:git fetch & git push & git pull
- 【学习总结】Git学习-上传本地已有代码到GitHub
- [AWS] Move Code from git to CodeCommit
- [Git] Squash all of my commits into a single one and merge into master
- [Practical Git] Configure global settings with git config
- [Practical Git] Compare file changes with git diff
- Jenkins Git构建基本远程代码库
- git schnnel failed to receive handshake, SSLTLS connection failed
- SAP Spartacus 的 git flow 和发布流程
- git的一个merge流程
- mac中使用 sourcetree 的快速配置和git服务器登录
- Git:合并分支----git merge命令应用的三种情景
- git for c#, commit本地,pushserver
- Git使用摘要
- git reset
- 一文吃透 VS Code+Git 操作(vs code中git的相关配置与使用)
- GitLabCICD实战----在.gitlab-ci.yml文件的步骤中使用git clone 另一个代码仓报错的解决办法
- Git的fatal: Not a git repository (or any parent up to mount point /home)
- git拉代码
- 【Git技巧】第七篇 git分区原理(超级详细)
- 管理git项目