mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
Merge pull request #429 from nicolaiskogheim/merge-into-ff-only
merge-into: change --ff option to --ff-only
This commit is contained in:
commit
ad83e447a6
|
|
@ -5,11 +5,11 @@ current_branch() {
|
|||
}
|
||||
|
||||
usage() {
|
||||
echo "Usage: git merge-into [src] dest [--ff]"
|
||||
echo "Usage: git merge-into [src] dest [--ff-only]"
|
||||
}
|
||||
|
||||
cur_branch=$(current_branch)
|
||||
if [ "${!#}" == '--ff' ]; then
|
||||
if [ "${!#}" == '--ff-only' ]; then
|
||||
case $# in
|
||||
2 ) # dest --ff
|
||||
git push "$(git rev-parse --show-toplevel)" "$cur_branch":"$1";;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "GIT\-MERGE\-INTO" "1" "April 2015" "" ""
|
||||
.TH "GIT\-MERGE\-INTO" "1" "August 2015" "" "Git Extras"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBgit\-merge\-into\fR \- Merge one branch into another
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
\fBgit merge\-into\fR [src] <dest> [\-\-ff]
|
||||
\fBgit merge\-into\fR [src] <dest> [\-\-ff\-only]
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Merge one branch into another, and keep yourself on current branch\. If src branch not given, it will merge current one to dest\.
|
||||
|
|
@ -25,10 +25,10 @@ The name of the branch will be merged into\. If this not given, use current bran
|
|||
The name of the branch to merge into\.
|
||||
.
|
||||
.P
|
||||
\-\-ff
|
||||
\-\-ff\-only
|
||||
.
|
||||
.P
|
||||
Try to use \fBgit push\fR instead of \fBgit merge\fR\. Only work on fast\-forward mode\.
|
||||
Refuse to merge and exit with a non\-zero status unless the current HEAD is already up\-to\-date or the merge can be resolved as a fast\-forward\.
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
Assume the following history exists and the current branch is src:
|
||||
|
|
@ -64,7 +64,7 @@ After running \fBgit merge\-into dest\fR, it will look like this:
|
|||
The \fBH\fR commit will record the merge result, just like what \fBgit merge\fR does\. And \fBsrc\fR is still the current branch\.
|
||||
.
|
||||
.P
|
||||
The default implementation of \fBmerge\-into\fR use \fBgit checkout\fR and \fBgit merge\fR, which may cause temporary change in the working tree\. If you make sure your branch can be merged fast\-forward, add \fB\-\-ff\fR to avoid files change\.
|
||||
The default implementation of \fBmerge\-into\fR use \fBgit checkout\fR and \fBgit merge\fR, which may cause temporary change in the working tree\. If you make sure your branch can be merged fast\-forward, add \fB\-\-ff\-only\fR to avoid files change\.
|
||||
.
|
||||
.SH "AUTHOR"
|
||||
Written by spacewander <\fIspacewanderlzx@gmail\.com\fR>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
<ol class='man-decor man-head man head'>
|
||||
<li class='tl'>git-merge-into(1)</li>
|
||||
<li class='tc'></li>
|
||||
<li class='tc'>Git Extras</li>
|
||||
<li class='tr'>git-merge-into(1)</li>
|
||||
</ol>
|
||||
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
||||
|
||||
<p><code>git merge-into</code> [src] <dest> [--ff]</p>
|
||||
<p><code>git merge-into</code> [src] <dest> [--ff-only]</p>
|
||||
|
||||
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
||||
|
||||
|
|
@ -92,9 +92,10 @@
|
|||
|
||||
<p> The name of the branch to merge into.</p>
|
||||
|
||||
<p> --ff</p>
|
||||
<p> --ff-only</p>
|
||||
|
||||
<p> Try to use <code>git push</code> instead of <code>git merge</code>. Only work on fast-forward mode.</p>
|
||||
<p> Refuse to merge and exit with a non-zero status unless the current HEAD is
|
||||
already up-to-date or the merge can be resolved as a fast-forward.</p>
|
||||
|
||||
<h2 id="EXAMPLES">EXAMPLES</h2>
|
||||
|
||||
|
|
@ -117,11 +118,11 @@ And <code>src</code> is still the current branch.</p>
|
|||
|
||||
<p>The default implementation of <code>merge-into</code> use <code>git checkout</code> and <code>git merge</code>,
|
||||
which may cause temporary change in the working tree. If you make sure your
|
||||
branch can be merged fast-forward, add <code>--ff</code> to avoid files change.</p>
|
||||
branch can be merged fast-forward, add <code>--ff-only</code> to avoid files change.</p>
|
||||
|
||||
<h2 id="AUTHOR">AUTHOR</h2>
|
||||
|
||||
<p>Written by spacewander <<a href="mailto:spacewanderlzx@gmail.com" data-bare-link="true">spacewanderlzx@gmail.com</a>></p>
|
||||
<p>Written by spacewander <<a href="mailto:spacewanderlzx@gmail.com" data-bare-link="true">spacewanderlzx@gmail.com</a>></p>
|
||||
|
||||
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
|
||||
|
||||
|
|
@ -134,7 +135,7 @@ branch can be merged fast-forward, add <code>--ff</code> to avoid files change.<
|
|||
|
||||
<ol class='man-decor man-foot man foot'>
|
||||
<li class='tl'></li>
|
||||
<li class='tc'>April 2015</li>
|
||||
<li class='tc'>August 2015</li>
|
||||
<li class='tr'>git-merge-into(1)</li>
|
||||
</ol>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ git-merge-into(1) -- Merge one branch into another
|
|||
|
||||
## SYNOPSIS
|
||||
|
||||
`git merge-into` [src] <dest> [--ff]
|
||||
`git merge-into` [src] <dest> [--ff-only]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
|
|
@ -19,9 +19,11 @@ Merge one branch into another, and keep yourself on current branch. If src branc
|
|||
|
||||
The name of the branch to merge into.
|
||||
|
||||
--ff
|
||||
--ff-only
|
||||
|
||||
Refuse to merge and exit with a non-zero status unless the current HEAD is
|
||||
already up-to-date or the merge can be resolved as a fast-forward.
|
||||
|
||||
Try to use `git push` instead of `git merge`. Only work on fast-forward mode.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
|
|
@ -42,7 +44,7 @@ And `src` is still the current branch.
|
|||
|
||||
The default implementation of `merge-into` use `git checkout` and `git merge`,
|
||||
which may cause temporary change in the working tree. If you make sure your
|
||||
branch can be merged fast-forward, add `--ff` to avoid files change.
|
||||
branch can be merged fast-forward, add `--ff-only` to avoid files change.
|
||||
|
||||
## AUTHOR
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue