提交 1cdda741 编写于 作者: M Mislav Marohnić

`git push remote1,remote2` without branch name pushes the current branch

上级 15d26d5f
......@@ -336,9 +336,9 @@ module Hub
# > git push origin cool-feature
# > git push staging cool-feature
def push(args)
return unless args[1] =~ /,/
return if args[1].nil? || !args[1].index(',')
branch = args[2]
branch = (args[2] ||= normalize_branch(current_branch))
remotes = args[1].split(',')
args[1] = remotes.shift
......
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "HUB" "1" "December 2010" "DEFUNKT" "Git Manual"
.TH "HUB" "1" "April 2011" "DEFUNKT" "Git Manual"
.
.SH "NAME"
\fBhub\fR \- git + hub = github
......@@ -37,7 +37,7 @@
\fBgit am\fR \fIGITHUB\-URL\fR
.
.br
\fBgit push\fR \fIREMOTE\-1\fR,\fIREMOTE\-2\fR,\.\.\.,\fIREMOTE\-N\fR \fIREF\fR
\fBgit push\fR \fIREMOTE\-1\fR,\fIREMOTE\-2\fR,\.\.\.,\fIREMOTE\-N\fR [\fIREF\fR]
.
.br
\fBgit browse\fR [\fB\-u\fR] [[\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR] [SUBPAGE]
......@@ -97,7 +97,7 @@ Sets the url of remote \fIREMOTE\-NAME\fR using the same rules as \fBgit remote
\fBgit am\fR \fIGITHUB\-URL\fR: Downloads the patch file for the pull request or commit at the URL and applies that patch from disk with \fBgit am\fR\. Similar to \fBcherry\-pick\fR, but doesn\'t add new remotes\.
.
.IP "\(bu" 4
\fBgit push\fR \fIREMOTE\-1\fR,\fIREMOTE\-2\fR,\.\.\.,\fIREMOTE\-N\fR \fIREF\fR: Push \fIREF\fR to each of \fIREMOTE\-1\fR through \fIREMOTE\-N\fR by executing multiple \fBgit push\fR commands\.
\fBgit push\fR \fIREMOTE\-1\fR,\fIREMOTE\-2\fR,\.\.\.,\fIREMOTE\-N\fR [\fIREF\fR]: Push \fIREF\fR to each of \fIREMOTE\-1\fR through \fIREMOTE\-N\fR by executing multiple \fBgit push\fR commands\.
.
.IP "\(bu" 4
\fBgit browse\fR [\fB\-u\fR] [[\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR] [SUBPAGE]: Open repository\'s GitHub page in the system\'s default web browser using \fBopen(1)\fR or the \fBBROWSER\fR env variable\. If the repository isn\'t specified, \fBbrowse\fR opens the page of the repository found in the current directory\. If SUBPAGE is specified, the browser will open on the specified subpage: one of "wiki", "commits", "issues" or other (the default is "tree")\.
......
......@@ -87,7 +87,7 @@
<code>git fetch</code> <var>USER-1</var>,[<var>USER-2</var>,...]<br />
<code>git cherry-pick</code> <var>GITHUB-REF</var><br />
<code>git am</code> <var>GITHUB-URL</var><br />
<code>git push</code> <var>REMOTE-1</var>,<var>REMOTE-2</var>,...,<var>REMOTE-N</var> <var>REF</var><br />
<code>git push</code> <var>REMOTE-1</var>,<var>REMOTE-2</var>,...,<var>REMOTE-N</var> [<var>REF</var>]<br />
<code>git browse</code> [<code>-u</code>] [[<var>USER</var><code>/</code>]<var>REPOSITORY</var>] [SUBPAGE]<br />
<code>git compare</code> [<code>-u</code>] [<var>USER</var>] [<var>START</var>...]<var>END</var><br />
<code>git submodule add</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var>/]<var>REPOSITORY</var> <var>DIRECTORY</var><br />
......@@ -141,7 +141,7 @@ prior to the cherry-pick attempt.</p></li>
Downloads the patch file for the pull request or commit at the URL and
applies that patch from disk with <code>git am</code>. Similar to <code>cherry-pick</code>, but
doesn't add new remotes.</p></li>
<li><p><code>git push</code> <var>REMOTE-1</var>,<var>REMOTE-2</var>,...,<var>REMOTE-N</var> <var>REF</var>:
<li><p><code>git push</code> <var>REMOTE-1</var>,<var>REMOTE-2</var>,...,<var>REMOTE-N</var> [<var>REF</var>]:
Push <var>REF</var> to each of <var>REMOTE-1</var> through <var>REMOTE-N</var> by executing
multiple <code>git push</code> commands.</p></li>
<li><p><code>git browse</code> [<code>-u</code>] [[<var>USER</var><code>/</code>]<var>REPOSITORY</var>] [SUBPAGE]:
......@@ -361,7 +361,7 @@ $ git help hub
<ol class='man-decor man-foot man foot'>
<li class='tl'>DEFUNKT</li>
<li class='tc'>December 2010</li>
<li class='tc'>April 2011</li>
<li class='tr'>hub(1)</li>
</ol>
......
......@@ -14,7 +14,7 @@ hub(1) -- git + hub = github
`git fetch` <USER-1>,[<USER-2>,...]
`git cherry-pick` <GITHUB-REF>
`git am` <GITHUB-URL>
`git push` <REMOTE-1>,<REMOTE-2>,...,<REMOTE-N> <REF>
`git push` <REMOTE-1>,<REMOTE-2>,...,<REMOTE-N> [<REF>]
`git browse` [`-u`] [[<USER>`/`]<REPOSITORY>] [SUBPAGE]
`git compare` [`-u`] [<USER>] [<START>...]<END>
`git submodule add` [`-p`] <OPTIONS> [<USER>/]<REPOSITORY> <DIRECTORY>
......@@ -76,7 +76,7 @@ alias command displays information on configuring your environment:
applies that patch from disk with `git am`. Similar to `cherry-pick`, but
doesn't add new remotes.
* `git push` <REMOTE-1>,<REMOTE-2>,...,<REMOTE-N> <REF>:
* `git push` <REMOTE-1>,<REMOTE-2>,...,<REMOTE-N> [<REF>]:
Push <REF> to each of <REMOTE-1> through <REMOTE-N> by executing
multiple `git push` commands.
......
......@@ -399,11 +399,21 @@ class HubTest < Test::Unit::TestCase
assert_equal "** No GitHub user set. See http://help.github.com/git-email-settings/\n", out
end
def test_push_untouched
assert_forwarded "push"
end
def test_push_two
assert_commands "git push origin cool-feature", "git push staging cool-feature",
"push origin,staging cool-feature"
end
def test_push_current_branch
stub_branch('refs/heads/cool-feature')
assert_commands "git push origin cool-feature", "git push staging cool-feature",
"push origin,staging"
end
def test_push_more
assert_commands "git push origin cool-feature",
"git push staging cool-feature",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册