add doc for git-pull-request and others

This commit is contained in:
spacewander 2016-07-28 00:08:20 +08:00
parent a062420224
commit 66560432ce
7 changed files with 255 additions and 5 deletions

View file

@ -36,20 +36,19 @@
- [`git obliterate`](#git-obliterate)
- [`git pr`](#git-pr)
- [`git psykorebase`](#git-psykorebase)
- [`git pull-request`](#git-pull-request)
- [`git rebase-patch`](#git-rebase-patch)
- [`git release`](#git-release)
- [`git rename-tag`](#git-rename-tag)
- [`git repl`](#git-repl)
- [`git reset-file`](#git-reset-file)
- [`git root`](#git-root)
- [`git scp`](#git-scp)
- [`git sed`](#git-sed)
- [`git setup`](#git-setup)
<<<<<<< HEAD
=======
- [`git show-merged-branches`](#git-show-merged-branches)
- [`git show-unmerged-branches`](#git-show-unmerged-branches)
- [`git show-tree`](#git-show-tree)
>>>>>>> 7c693c3... add git-show-(un)merged-branches to Commands.md
- [`git standup`](#git-standup)
- [`git squash`](#git-squash)
- [`git summary`](#git-summary)
@ -348,6 +347,29 @@ Does the following:
- Push the branch / tags
- Executes _.git/hooks/post-release.sh_ (if present)
## git rename-tag
Rename a tag (locally and remotely).
```
$ git tag test
$ git push --tags
Total 0 (delta 0), reused 0 (delta 0)
To git@myserver.com:myuser/myrepository.git
* [new tag] test -> test
$ git tag
test
$ git rename-tag test test2
Deleted tag 'test' (was 1111111)
Total 0 (delta 0), reused 0 (delta 0)
To git@myserver.com:myuser/myrepository.git
* [new tag] test2 -> test2
remote: warning: Deleting a non-existent ref.
To git@myserver.com:myuser/myrepository.git
- [deleted] refs/tag/test
$ git tag
test2
```
## git alias
Define, search and show aliases.
@ -1050,6 +1072,10 @@ $ git psykorebase master feature
The above rebase `feature` branch on top of `master` branch
## git pull-request
Create pull request via commandline.
## git rebase-patch
Given you have a patch that doesn´t apply to the current HEAD, but you know it applied to some commit in the past,

View file

@ -20,7 +20,7 @@ read user
# extract owner + project from repo url
project=${url##*/}
owner=${url%/$project}
[[ $project == *.git ]] && project=${project%.git}
project=${project%.git}
if [[ $owner == git@* ]]; then
owner=${owner##*:}
else

View file

@ -39,7 +39,13 @@ git push origin $branch || abort "failed to push $branch"
# lame hack to get project
project=$(git config remote.origin.url | sed 's/^.*://' | sed 's/\.git$//')
origin=$(git config remote.origin.url)
if [[ $origin == git@* ]]; then
project=${origin##*:}
else
project=${origin#https://*/}
fi
project=${project%.git}
# prompt

View file

@ -389,6 +389,7 @@ zstyle ':completion:*:*:git:*' user-commands \
obliterate:'rewrite past commits to remove some files' \
pr:'checks out a pull request locally' \
psykorebase:'rebase a branch with a merge commit' \
pull-request:'create pull request to GitHub project' \
rebase-patch:'rebases a patch' \
refactor:'create refactor branch' \
release:'commit, tag and push changes to the repository' \

46
man/git-pull-request.1 Normal file
View file

@ -0,0 +1,46 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-PULL\-REQUEST" "1" "July 2016" "" ""
.
.SH "NAME"
\fBgit\-pull\-request\fR \- Create pull request for GitHub project
.
.SH "SYNOPSIS"
\fBgit\-pull\-request\fR [<target branch>]
.
.SH "DESCRIPTION"
Create pull request for a project on GitHub via commandline\.
.
.SH "OPTIONS"
<target branch>
.
.P
The target branch you want to send pull request to\.
.
.SH "EXAMPLES"
.
.nf
$ git pull\-request master
Everything up\-to\-date
create pull\-request for spacewander/spacewander\-toolbox \'master\'
title: test
body:
base [master]:
Enter host password for user \'spacewanderlzx@gmail\.com\':
\.\.\.
.
.fi
.
.SH "AUTHOR"
Written by Tj Holowaychuk <\fItj@vision\-media\.ca\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/tj/git\-extras\fR>

127
man/git-pull-request.html Normal file
View file

@ -0,0 +1,127 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<title>git-pull-request(1) - Create pull request for GitHub project</title>
<style type='text/css' media='all'>
/* style: man */
body#manpage {margin:0}
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
.mp h2 {margin:10px 0 0 0}
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
.mp h3 {margin:0 0 0 4ex}
.mp dt {margin:0;clear:left}
.mp dt.flush {float:left;width:8ex}
.mp dd {margin:0 0 0 9ex}
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
.mp pre {margin-bottom:20px}
.mp pre+h2,.mp pre+h3 {margin-top:22px}
.mp h2+pre,.mp h3+pre {margin-top:5px}
.mp img {display:block;margin:auto}
.mp h1.man-title {display:none}
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
.mp h2 {font-size:16px;line-height:1.25}
.mp h1 {font-size:20px;line-height:2}
.mp {text-align:justify;background:#fff}
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
.mp u {text-decoration:underline}
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
.mp b.man-ref {font-weight:normal;color:#434241}
.mp pre {padding:0 4ex}
.mp pre code {font-weight:normal;color:#434241}
.mp h2+pre,h3+pre {padding-left:0}
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
ol.man-decor {width:100%}
ol.man-decor li.tl {text-align:left}
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
ol.man-decor li.tr {text-align:right;float:right}
</style>
</head>
<!--
The following styles are deprecated and will be removed at some point:
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
.man-navigation should be used instead.
-->
<body id='manpage'>
<div class='mp' id='man'>
<div class='man-navigation' style='display:none'>
<a href="#NAME">NAME</a>
<a href="#SYNOPSIS">SYNOPSIS</a>
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#OPTIONS">OPTIONS</a>
<a href="#EXAMPLES">EXAMPLES</a>
<a href="#AUTHOR">AUTHOR</a>
<a href="#REPORTING-BUGS">REPORTING BUGS</a>
<a href="#SEE-ALSO">SEE ALSO</a>
</div>
<ol class='man-decor man-head man head'>
<li class='tl'>git-pull-request(1)</li>
<li class='tc'></li>
<li class='tr'>git-pull-request(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-pull-request</code> - <span class="man-whatis">Create pull request for GitHub project</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-pull-request</code> [&lt;target branch&gt;]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>Create pull request for a project on GitHub via commandline.</p>
<h2 id="OPTIONS">OPTIONS</h2>
<p>&lt;target branch&gt;</p>
<p>The target branch you want to send pull request to.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<pre><code>$ git pull-request master
Everything up-to-date
create pull-request for spacewander/spacewander-toolbox 'master'
title: test
body:
base [master]:
Enter host password for user 'spacewanderlzx@gmail.com':
...
</code></pre>
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Tj Holowaychuk &lt;<a href="&#109;&#97;&#105;&#108;&#116;&#x6f;&#x3a;&#116;&#106;&#x40;&#118;&#105;&#115;&#105;&#x6f;&#110;&#45;&#x6d;&#101;&#100;&#105;&#x61;&#x2e;&#99;&#x61;" data-bare-link="true">&#116;&#106;&#x40;&#x76;&#105;&#x73;&#105;&#111;&#110;&#45;&#x6d;&#x65;&#x64;&#x69;&#x61;&#46;&#99;&#97;</a>&gt;</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
<p>&lt;<a href="https://github.com/tj/git-extras/issues" data-bare-link="true">https://github.com/tj/git-extras/issues</a>&gt;</p>
<h2 id="SEE-ALSO">SEE ALSO</h2>
<p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>July 2016</li>
<li class='tr'>git-pull-request(1)</li>
</ol>
</div>
</body>
</html>

44
man/git-pull-request.md Normal file
View file

@ -0,0 +1,44 @@
git-pull-request(1) -- Create pull request for GitHub project
================================
## SYNOPSIS
`git-pull-request` [&lt;target branch&gt;]
## DESCRIPTION
Create pull request for a project on GitHub via commandline.
## OPTIONS
&lt;target branch&gt;
The target branch you want to send pull request to.
## EXAMPLES
```
$ git pull-request master
Everything up-to-date
create pull-request for spacewander/spacewander-toolbox 'master'
title: test
body:
base [master]:
Enter host password for user 'spacewanderlzx@gmail.com':
...
```
## AUTHOR
Written by Tj Holowaychuk &lt;<tj@vision-media.ca>&gt;
## REPORTING BUGS
&lt;<https://github.com/tj/git-extras/issues>&gt;
## SEE ALSO
&lt;<https://github.com/tj/git-extras>&gt;