Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitflow
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tools
gitflow
Commits
788227b4
Commit
788227b4
authored
Jan 26, 2010
by
Vincent Driessen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'make-feature-work' into develop
parents
144bb507
65cdbb7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
11 deletions
+41
-11
gitflow-feature
gitflow-feature
+39
-10
gitflow-sh-setup
gitflow-sh-setup
+2
-1
No files found.
gitflow-feature
View file @
788227b4
...
@@ -13,8 +13,21 @@
...
@@ -13,8 +13,21 @@
#
#
usage
()
{
usage
()
{
echo
"usage: gitflow start feature <name> [<base>]"
echo
"usage: gitflow start feature [<options>] <name> [<base>]"
echo
" gitflow finish feature <name>"
echo
" gitflow finish feature [<options>] <name>"
# TODO
#echo ""
#echo "options:"
#echo "--option Explanation"
#echo ""
#echo "start-only options:"
#echo "--option Explanation"
#echo ""
#echo "finish-only options:"
#echo "--rebase Rebases the feature branch on top of develop, instead of merging"
#echo "--squash Squashes all commits of the feature branch into a single commit"
#echo " on develop"
#echo "--push Push to the origin repo when finished"
}
}
parse_args
()
{
parse_args
()
{
...
@@ -25,7 +38,7 @@ parse_args() {
...
@@ -25,7 +38,7 @@ parse_args() {
BASE
=
"develop"
BASE
=
"develop"
fi
fi
if
[
"
$FEATURE
"
=
""
]
;
then
if
[
"
$FEATURE
"
=
""
]
;
then
echo
"Missing argument <release>
.
"
echo
"Missing argument <release>"
usage
usage
exit
1
exit
1
fi
fi
...
@@ -42,7 +55,16 @@ start() {
...
@@ -42,7 +55,16 @@ start() {
fi
fi
# All checks passed, ready to roll
# All checks passed, ready to roll
echo
"git checkout -b
$FEATURE
$BASE
"
git checkout
-b
"
$FEATURE
"
"
$BASE
"
echo
""
echo
"Summary of actions:"
echo
"- A new branch '
$FEATURE
' was created, based on '
$BASE
'"
echo
"- You are now on branch '
$FEATURE
'"
echo
""
echo
"Now, start committing on your feature. When done, use:"
echo
""
echo
" gitflow finish feature '
$FEATURE
'"
}
}
finish
()
{
finish
()
{
...
@@ -51,13 +73,20 @@ finish() {
...
@@ -51,13 +73,20 @@ finish() {
# Checks
# Checks
gitflow_check_clean_working_tree
gitflow_check_clean_working_tree
gitflow_require_branch
"
$FEATURE
"
gitflow_require_branch
"
$FEATURE
"
if
[
"
$BASE
"
=
"develop"
]
;
then
gitflow_require_branches_equal
'develop'
'origin/develop'
gitflow_require_branches_equal
'develop'
'origin/develop'
fi
# All checks passed, ready to roll
# All checks passed, ready to roll
echo
"git checkout
$BASE
"
git checkout develop
echo
"git merge --no-ff
$FEATURE
"
git merge
--no-ff
"
$FEATURE
"
echo
"git branch -d
$FEATURE
"
# TODO: How do we handle merge conflicts here??
git branch
-d
"
$FEATURE
"
echo
""
echo
"Summary of actions:"
echo
"- The feature branch '
$FEATURE
' was merged into 'develop'"
#echo "- Merge conflicts were resolved" # TODO: Add this line when it's supported
echo
"- Feature branch '
$FEATURE
' has been removed"
echo
"- You are now on branch 'develop'"
echo
""
}
}
gitflow-sh-setup
View file @
788227b4
...
@@ -98,7 +98,8 @@ gitflow_require_branches_equal() {
...
@@ -98,7 +98,8 @@ gitflow_require_branches_equal() {
if
[
$status
-eq
1
]
;
then
if
[
$status
-eq
1
]
;
then
die
"And branch '
$1
' may be fast-forwarded."
die
"And branch '
$1
' may be fast-forwarded."
elif
[
$status
-eq
2
]
;
then
elif
[
$status
-eq
2
]
;
then
die
"And local branch '
$1
' is ahead of '
$2
'."
# Warn here, since there is no harm in being ahead
warn
"And local branch '
$1
' is ahead of '
$2
'."
else
else
die
"Branches need merging first."
die
"Branches need merging first."
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment