Skip to content

Commit c81110e

Browse files
committed
add doc for git-pull-request and others
1 parent 2898318 commit c81110e

File tree

7 files changed

+255
-2
lines changed

7 files changed

+255
-2
lines changed

Commands.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
- [`git obliterate`](#git-obliterate)
3737
- [`git pr`](#git-pr)
3838
- [`git psykorebase`](#git-psykorebase)
39+
- [`git pull-request`](#git-pull-request)
3940
- [`git rebase-patch`](#git-rebase-patch)
4041
- [`git release`](#git-release)
42+
- [`git rename-tag`](#git-rename-tag)
4143
- [`git repl`](#git-repl)
4244
- [`git reset-file`](#git-reset-file)
4345
- [`git root`](#git-root)
@@ -345,6 +347,29 @@ Does the following:
345347
- Push the branch / tags
346348
- Executes _.git/hooks/post-release.sh_ (if present)
347349

350+
## git rename-tag
351+
352+
Rename a tag (locally and remotely).
353+
```
354+
$ git tag test
355+
$ git push --tags
356+
Total 0 (delta 0), reused 0 (delta 0)
357+
To [email protected]:myuser/myrepository.git
358+
* [new tag] test -> test
359+
$ git tag
360+
test
361+
$ git rename-tag test test2
362+
Deleted tag 'test' (was 1111111)
363+
Total 0 (delta 0), reused 0 (delta 0)
364+
To [email protected]:myuser/myrepository.git
365+
* [new tag] test2 -> test2
366+
remote: warning: Deleting a non-existent ref.
367+
To [email protected]:myuser/myrepository.git
368+
- [deleted] refs/tag/test
369+
$ git tag
370+
test2
371+
```
372+
348373
## git alias
349374

350375
Define, search and show aliases.
@@ -1047,6 +1072,10 @@ $ git psykorebase master feature
10471072
10481073
The above rebase `feature` branch on top of `master` branch
10491074
1075+
## git pull-request
1076+
1077+
Create pull request via commandline.
1078+
10501079
## git rebase-patch
10511080
10521081
Given you have a patch that doesn´t apply to the current HEAD, but you know it applied to some commit in the past,

bin/git-fork

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ read user
2020
# extract owner + project from repo url
2121
project=${url##*/}
2222
owner=${url%/$project}
23-
[[ $project == *.git ]] && project=${project%.git}
23+
project=${project%.git}
2424
if [[ $owner == git@* ]]; then
2525
owner=${owner##*:}
2626
else

bin/git-pull-request

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ git push origin $branch || abort "failed to push $branch"
3939

4040
# lame hack to get project
4141

42-
project=$(git config remote.origin.url | sed 's/^.*://' | sed 's/\.git$//')
42+
origin=$(git config remote.origin.url)
43+
if [[ $origin == git@* ]]; then
44+
project=${origin##*:}
45+
else
46+
project=${origin#https://*/}
47+
fi
48+
project=${project%.git}
4349

4450
# prompt
4551

etc/git-extras-completion.zsh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ zstyle ':completion:*:*:git:*' user-commands \
389389
obliterate:'rewrite past commits to remove some files' \
390390
pr:'checks out a pull request locally' \
391391
psykorebase:'rebase a branch with a merge commit' \
392+
pull-request:'create pull request to GitHub project' \
392393
rebase-patch:'rebases a patch' \
393394
refactor:'create refactor branch' \
394395
release:'commit, tag and push changes to the repository' \

man/git-pull-request.1

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.\" generated with Ronn/v0.7.3
2+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
3+
.
4+
.TH "GIT\-PULL\-REQUEST" "1" "July 2016" "" ""
5+
.
6+
.SH "NAME"
7+
\fBgit\-pull\-request\fR \- Create pull request for GitHub project
8+
.
9+
.SH "SYNOPSIS"
10+
\fBgit\-pull\-request\fR [<target branch>]
11+
.
12+
.SH "DESCRIPTION"
13+
Create pull request for a project on GitHub via commandline\.
14+
.
15+
.SH "OPTIONS"
16+
<target branch>
17+
.
18+
.P
19+
The target branch you want to send pull request to\.
20+
.
21+
.SH "EXAMPLES"
22+
.
23+
.nf
24+
25+
$ git pull\-request master
26+
Everything up\-to\-date
27+
28+
create pull\-request for spacewander/spacewander\-toolbox \'master\'
29+
30+
title: test
31+
body:
32+
base [master]:
33+
34+
Enter host password for user \'spacewanderlzx@gmail\.com\':
35+
\.\.\.
36+
.
37+
.fi
38+
.
39+
.SH "AUTHOR"
40+
Written by Tj Holowaychuk <\fItj@vision\-media\.ca\fR>
41+
.
42+
.SH "REPORTING BUGS"
43+
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
44+
.
45+
.SH "SEE ALSO"
46+
<\fIhttps://github\.com/tj/git\-extras\fR>

man/git-pull-request.html

Lines changed: 127 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/git-pull-request.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
git-pull-request(1) -- Create pull request for GitHub project
2+
================================
3+
4+
## SYNOPSIS
5+
6+
`git-pull-request` [&lt;target branch&gt;]
7+
8+
## DESCRIPTION
9+
10+
Create pull request for a project on GitHub via commandline.
11+
12+
## OPTIONS
13+
14+
&lt;target branch&gt;
15+
16+
The target branch you want to send pull request to.
17+
18+
## EXAMPLES
19+
20+
```
21+
$ git pull-request master
22+
Everything up-to-date
23+
24+
create pull-request for spacewander/spacewander-toolbox 'master'
25+
26+
title: test
27+
body:
28+
base [master]:
29+
30+
Enter host password for user '[email protected]':
31+
...
32+
```
33+
34+
## AUTHOR
35+
36+
Written by Tj Holowaychuk &lt;<[email protected]>&gt;
37+
38+
## REPORTING BUGS
39+
40+
&lt;<https://github.com/tj/git-extras/issues>&gt;
41+
42+
## SEE ALSO
43+
44+
&lt;<https://github.com/tj/git-extras>&gt;

0 commit comments

Comments
 (0)