mirror of
https://github.com/tj/git-extras.git
synced 2026-09-12 08:26:17 -04:00
Merge pull request #188 from twolfson/dev/add.multi.delete.squashed
Added multi-delete for git-delete-branch and git-delete-tag.
This commit is contained in:
commit
ab5c0364f6
3
AUTHORS
3
AUTHORS
|
|
@ -21,4 +21,5 @@ Patches and Suggestions
|
|||
- Devin Withers
|
||||
- David Baumgold
|
||||
- Leila Muhtasib
|
||||
- Duane Johnson
|
||||
- Duane Johnson
|
||||
- Todd Wolfson
|
||||
|
|
@ -1,7 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
branch=$1
|
||||
test -z $branch && echo "branch required." 1>&2 && exit 1
|
||||
git branch -D $branch
|
||||
git branch -d -r origin/$branch
|
||||
git push origin :refs/heads/$branch
|
||||
# Assert there is at least one branch provided
|
||||
test -z $1 && echo "branch required." 1>&2 && exit 1
|
||||
|
||||
# Concatenate all branch references
|
||||
local_branches=""
|
||||
origin_branches=""
|
||||
origin_refs=""
|
||||
for branch in "$@"
|
||||
do
|
||||
local_branches=$local_branches" $branch"
|
||||
origin_branches=$origin_branches" origin/$branch"
|
||||
origin_refs=$origin_refs" :refs/heads/$branch"
|
||||
done
|
||||
|
||||
# Delete all branches
|
||||
git branch -D $local_branches
|
||||
git branch -d -r $origin_branches
|
||||
git push origin $origin_refs
|
||||
|
|
|
|||
|
|
@ -1,6 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
tagname=$1
|
||||
test -z $tagname && echo "tag required." 1>&2 && exit 1
|
||||
git tag -d $tagname
|
||||
git push origin :refs/tags/$tagname
|
||||
# Assert there is at least one tag provided
|
||||
test -z $1 && echo "tag required." 1>&2 && exit 1
|
||||
|
||||
# Concatenate all the tag references
|
||||
local_tags=""
|
||||
origin_refs=""
|
||||
for tagname in "$@"
|
||||
do
|
||||
local_tags=$local_tags" $tagname"
|
||||
origin_refs=$origin_refs" :refs/tags/$tagname"
|
||||
done
|
||||
|
||||
# Delete all the tags
|
||||
git tag -d $local_tags
|
||||
git push origin $origin_refs
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" https://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "GIT\-DELETE\-BRANCH" "1" "July 2012" "" ""
|
||||
.TH "GIT\-DELETE\-BRANCH" "1" "September 2013" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBgit\-delete\-branch\fR \- Delete branches
|
||||
|
|
@ -10,19 +10,20 @@
|
|||
\fBgit\-delete\-branch\fR <branchname>
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Deletes local and remote branch named <branchname>\.
|
||||
Deletes local and remote branch named <branchname>\. Note that local deletion fails if the branch is checked out\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
<branchname>
|
||||
.
|
||||
.P
|
||||
The name of the branch to delete\.
|
||||
The name of the branch to delete\. If multiple branches are provided, then they will all be deleted\.
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.nf
|
||||
|
||||
$ git delete\-branch integration
|
||||
$ git delete\-branch integration bug/1234
|
||||
.
|
||||
.fi
|
||||
.
|
||||
|
|
@ -30,7 +31,7 @@ $ git delete\-branch integration
|
|||
Written by Tj Holowaychuk <\fItj@vision\-media\.ca\fR>
|
||||
.
|
||||
.SH "REPORTING BUGS"
|
||||
<\fIhttp://github\.com/visionmedia/git\-extras/issues\fR>
|
||||
<\fIhttps://github\.com/visionmedia/git\-extras/issues\fR>
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
<\fIhttp://github\.com/visionmedia/git\-extras\fR>
|
||||
<\fIhttps://github\.com/visionmedia/git\-extras\fR>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
||||
<meta name='generator' value='Ronn/v0.7.3 (https://github.com/rtomayko/ronn/tree/0.7.3)'>
|
||||
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
||||
<title>git-delete-branch(1) - Delete branches</title>
|
||||
<style type='text/css' media='all'>
|
||||
/* style: man */
|
||||
|
|
@ -80,22 +80,25 @@
|
|||
|
||||
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
||||
|
||||
<p> Deletes local and remote branch named <branchname>.</p>
|
||||
<p> Deletes local and remote branch named <branchname>.
|
||||
Note that local deletion fails if the branch is checked out.</p>
|
||||
|
||||
<h2 id="OPTIONS">OPTIONS</h2>
|
||||
|
||||
<p> <branchname></p>
|
||||
|
||||
<p> The name of the branch to delete.</p>
|
||||
<p> The name of the branch to delete.
|
||||
If multiple branches are provided, then they will all be deleted.</p>
|
||||
|
||||
<h2 id="EXAMPLES">EXAMPLES</h2>
|
||||
|
||||
<pre><code>$ git delete-branch integration
|
||||
$ git delete-branch integration bug/1234
|
||||
</code></pre>
|
||||
|
||||
<h2 id="AUTHOR">AUTHOR</h2>
|
||||
|
||||
<p>Written by Tj Holowaychuk <<a href="mailto:tj@vision-media.ca" data-bare-link="true">tj@vision-media.ca</a>></p>
|
||||
<p>Written by Tj Holowaychuk <<a href="mailto:tj@vision-media.ca" data-bare-link="true">tj@vision-media.ca</a>></p>
|
||||
|
||||
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
|
||||
|
||||
|
|
@ -108,7 +111,7 @@
|
|||
|
||||
<ol class='man-decor man-foot man foot'>
|
||||
<li class='tl'></li>
|
||||
<li class='tc'>July 2012</li>
|
||||
<li class='tc'>September 2013</li>
|
||||
<li class='tr'>git-delete-branch(1)</li>
|
||||
</ol>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,10 +15,12 @@ git-delete-branch(1) -- Delete branches
|
|||
<branchname>
|
||||
|
||||
The name of the branch to delete.
|
||||
If multiple branches are provided, then they will all be deleted.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
$ git delete-branch integration
|
||||
$ git delete-branch integration bug/1234
|
||||
|
||||
## AUTHOR
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" https://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "GIT\-DELETE\-TAG" "1" "July 2012" "" ""
|
||||
.TH "GIT\-DELETE\-TAG" "1" "September 2013" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBgit\-delete\-tag\fR \- Delete tags
|
||||
|
|
@ -16,13 +16,14 @@ Deletes local and remote tag named <tagname>\.
|
|||
<tagname>
|
||||
.
|
||||
.P
|
||||
The name of the branch to delete\.
|
||||
The name of the tag to delete\. If multiple tags are provided, then they will all be deleted\.
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.nf
|
||||
|
||||
$ git delete\-tag 0\.0\.1
|
||||
$ git delete\-tag 0\.0\.1 0\.0\.2
|
||||
.
|
||||
.fi
|
||||
.
|
||||
|
|
@ -30,7 +31,7 @@ $ git delete\-tag 0\.0\.1
|
|||
Written by Tj Holowaychuk <\fItj@vision\-media\.ca\fR>
|
||||
.
|
||||
.SH "REPORTING BUGS"
|
||||
<\fIhttp://github\.com/visionmedia/git\-extras/issues\fR>
|
||||
<\fIhttps://github\.com/visionmedia/git\-extras/issues\fR>
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
<\fIhttp://github\.com/visionmedia/git\-extras\fR>
|
||||
<\fIhttps://github\.com/visionmedia/git\-extras\fR>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
||||
<meta name='generator' value='Ronn/v0.7.3 (https://github.com/rtomayko/ronn/tree/0.7.3)'>
|
||||
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
||||
<title>git-delete-tag(1) - Delete tags</title>
|
||||
<style type='text/css' media='all'>
|
||||
/* style: man */
|
||||
|
|
@ -86,16 +86,18 @@
|
|||
|
||||
<p> <tagname></p>
|
||||
|
||||
<p> The name of the branch to delete.</p>
|
||||
<p> The name of the tag to delete.
|
||||
If multiple tags are provided, then they will all be deleted.</p>
|
||||
|
||||
<h2 id="EXAMPLES">EXAMPLES</h2>
|
||||
|
||||
<pre><code>$ git delete-tag 0.0.1
|
||||
$ git delete-tag 0.0.1 0.0.2
|
||||
</code></pre>
|
||||
|
||||
<h2 id="AUTHOR">AUTHOR</h2>
|
||||
|
||||
<p>Written by Tj Holowaychuk <<a href="mailto:tj@vision-media.ca" data-bare-link="true">tj@vision-media.ca</a>></p>
|
||||
<p>Written by Tj Holowaychuk <<a href="mailto:tj@vision-media.ca" data-bare-link="true">tj@vision-media.ca</a>></p>
|
||||
|
||||
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
|
||||
|
||||
|
|
@ -108,7 +110,7 @@
|
|||
|
||||
<ol class='man-decor man-foot man foot'>
|
||||
<li class='tl'></li>
|
||||
<li class='tc'>July 2012</li>
|
||||
<li class='tc'>September 2013</li>
|
||||
<li class='tr'>git-delete-tag(1)</li>
|
||||
</ol>
|
||||
|
||||
|
|
|
|||
|
|
@ -13,11 +13,13 @@ git-delete-tag(1) -- Delete tags
|
|||
|
||||
<tagname>
|
||||
|
||||
The name of the branch to delete.
|
||||
The name of the tag to delete.
|
||||
If multiple tags are provided, then they will all be deleted.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
$ git delete-tag 0.0.1
|
||||
$ git delete-tag 0.0.1 0.0.2
|
||||
|
||||
## AUTHOR
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue