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
d2240e40
Commit
d2240e40
authored
Jan 26, 2010
by
Benedikt Böhm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/configurable-main-branches' into develop
parents
4ea07a2c
96f44c07
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
54 deletions
+58
-54
TODO.mdown
TODO.mdown
+0
-3
git-flow
git-flow
+5
-2
git-flow-feature
git-flow-feature
+20
-19
git-flow-hotfix
git-flow-hotfix
+14
-13
git-flow-release
git-flow-release
+14
-13
git-flow-support
git-flow-support
+5
-4
No files found.
TODO.mdown
View file @
d2240e40
...
...
@@ -3,9 +3,6 @@ TODO-list
General configuration
---------------------
- Support configurable naming for fixed branch names 'master' and 'develop'
- Support configurable naming conventions (i.e. name prefixes) for supporting
branches, instead of fixed 'release-\*' and 'hotfix-\*'
Release branch support
----------------------
...
...
git-flow
View file @
d2240e40
...
...
@@ -18,6 +18,11 @@ if [ "$DEBUG" = "yes" ]; then
set
-x
fi
export
GITFLOW_DIR
=
$(
dirname
"
$0
"
)
export
MASTER_BRANCH
=
$(
git config
--get
gitflow.branch.master
||
echo
master
)
export
DEVELOP_BRANCH
=
$(
git config
--get
gitflow.branch.develop
||
echo
develop
)
export
ORIGIN
=
$(
git config
--get
gitflow.origin
||
echo
origin
)
warn
()
{
echo
"
$@
"
>
&2
;
}
die
()
{
warn
"
$@
"
;
exit
1
;
}
has
()
{
[[
"
${
*
:2
}
"
==
*
"
$1
"
*
]]
;
}
...
...
@@ -36,8 +41,6 @@ main() {
exit
1
fi
export
GITFLOW_DIR
=
$(
dirname
"
$0
"
)
# sanity checks
ACTION
=
"
$1
"
BTYPE
=
"
$2
"
...
...
git-flow-feature
View file @
d2240e40
...
...
@@ -34,13 +34,14 @@ usage() {
parse_args() {
NAME="$1"
BASE="${2:-
develop
}"
BASE="${2:-
$DEVELOP_BRANCH
}"
if [ "$NAME" = "" ]; then
echo "Missing argument <name>."
usage
exit 1
fi
BRANCH=feature/$NAME
PREFIX=$(git config --get gitflow.prefix.feature || echo feature/)
BRANCH=$PREFIX$NAME
}
cmd_help() {
...
...
@@ -54,9 +55,9 @@ cmd_start() {
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branch_absent $BRANCH
if [ "$BASE" = "
develop
" ]; then
git fetch
origin develop
gitflow_require_branches_equal
develop origin/develop
if [ "$BASE" = "
$DEVELOP_BRANCH
" ]; then
git fetch
$ORIGIN $DEVELOP_BRANCH
gitflow_require_branches_equal
$DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
fi
# create branch
...
...
@@ -79,12 +80,12 @@ cmd_finish() {
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branch $BRANCH
git fetch
origin
if has
origin
/$BRANCH $REMOTE_BRANCHES; then
gitflow_require_branches_equal $BRANCH
origin
/$BRANCH
git fetch
$ORIGIN
if has
$ORIGIN
/$BRANCH $REMOTE_BRANCHES; then
gitflow_require_branches_equal $BRANCH
$ORIGIN
/$BRANCH
fi
if [ "$BASE" = "
develop
" ]; then
gitflow_require_branches_equal
develop origin/develop
if [ "$BASE" = "
$DEVELOP_BRANCH
" ]; then
gitflow_require_branches_equal
$DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
fi
# merge into BASE
...
...
@@ -97,7 +98,7 @@ cmd_finish() {
# delete branch
# TODO: How do we handle merge conflicts here??
git push
origin
:refs/heads/$BRANCH
git push
$ORIGIN
:refs/heads/$BRANCH
git branch -d $BRANCH
echo
...
...
@@ -115,15 +116,15 @@ cmd_publish() {
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branch $BRANCH
git fetch
origin
gitflow_require_branch_absent
origin
/$BRANCH
git fetch
$ORIGIN
gitflow_require_branch_absent
$ORIGIN
/$BRANCH
# create remote branch
git push
origin
$BRANCH:refs/heads/$BRANCH
git fetch
origin
git push
$ORIGIN
$BRANCH:refs/heads/$BRANCH
git fetch
$ORIGIN
# configure remote tracking
git config branch.$BRANCH.remote
origin
git config branch.$BRANCH.remote
$ORIGIN
git config branch.$BRANCH.merge refs/heads/$BRANCH
git checkout $BRANCH
...
...
@@ -141,11 +142,11 @@ cmd_track() {
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branch_absent $BRANCH
git fetch
origin
gitflow_require_branch
origin
/$BRANCH
git fetch
$ORIGIN
gitflow_require_branch
$ORIGIN
/$BRANCH
# create tracking branch
git checkout -b $BRANCH
origin
/$BRANCH
git checkout -b $BRANCH
$ORIGIN
/$BRANCH
echo
echo "Summary of actions:"
...
...
git-flow-hotfix
View file @
d2240e40
...
...
@@ -29,13 +29,14 @@ usage() {
parse_args() {
VERSION="$1"
BASE="${2:-
master
}"
BASE="${2:-
$MASTER_BRANCH
}"
if [ "$VERSION" = "" ]; then
echo "Missing argument <version>."
usage
exit 1
fi
BRANCH=hotfix/$VERSION
PREFIX=$(git config --get gitflow.prefix.hotfix || echo hotfix/)
BRANCH=$PREFIX$VERSION
}
cmd_help() {
...
...
@@ -48,8 +49,8 @@ cmd_start() {
# sanity checks
gitflow_check_clean_working_tree
git fetch
origin
gitflow_require_branches_equal
master origin/master
git fetch
$ORIGIN
gitflow_require_branches_equal
$MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
gitflow_require_branch_absent $BRANCH
# create branch
...
...
@@ -74,10 +75,10 @@ cmd_finish() {
# sanity checks
gitflow_check_clean_working_tree
git fetch
origin master
git fetch
origin develop
gitflow_require_branches_equal
master origin/master
gitflow_require_branches_equal
develop origin/develop
git fetch
$ORIGIN $MASTER_BRANCH
git fetch
$ORIGIN $DEVELOP_BRANCH
gitflow_require_branches_equal
$MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
gitflow_require_branches_equal
$DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
# merge into BASE
git checkout $BASE
...
...
@@ -86,8 +87,8 @@ cmd_finish() {
# merge into develop if we fixed a master issue
# TODO: merge into support branch
if [ "$BASE" = "
master
" ]; then
git checkout
develop
if [ "$BASE" = "
$MASTER_BRANCH
" ]; then
git checkout
$DEVELOP_BRANCH
git merge --no-ff $BRANCH
fi
...
...
@@ -99,11 +100,11 @@ cmd_finish() {
echo
echo "Summary of actions:"
echo "- Latest objects have been fetched from '
origin
'"
echo "- Latest objects have been fetched from '
$ORIGIN
'"
echo "- Hotfix branch has been merged into '$BASE'"
echo "- The hotfix was tagged 'v$VERSION'"
if [ "$BASE" = "
master
" ]; then
echo "- Hotfix branch has been back-merged into '
develop
'"
if [ "$BASE" = "
$MASTER_BRANCH
" ]; then
echo "- Hotfix branch has been back-merged into '
$DEVELOP_BRANCH
'"
fi
echo "- Hotfix branch '$BRANCH' has been deleted"
echo
...
...
git-flow-release
View file @
d2240e40
...
...
@@ -35,7 +35,8 @@ parse_args() {
usage
exit 1
fi
BRANCH=release/$VERSION
PREFIX=$(git config --get gitflow.prefix.release || echo release/)
BRANCH=$PREFIX$VERSION
}
cmd_help() {
...
...
@@ -48,16 +49,16 @@ cmd_start() {
# sanity checks
gitflow_check_clean_working_tree
git fetch
origin
gitflow_require_branches_equal
develop origin/develop
git fetch
$ORIGIN
gitflow_require_branches_equal
$DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
gitflow_require_branch_absent $BRANCH
# create branch
git checkout -b $BRANCH
develop
git checkout -b $BRANCH
$DEVELOP_BRANCH
echo
echo "Summary of actions:"
echo "- A new branch '$BRANCH' was created, based on '
develop
'"
echo "- A new branch '$BRANCH' was created, based on '
$DEVELOP_BRANCH
'"
echo "- You are now on branch '$BRANCH'"
echo
echo "Follow-up actions:"
...
...
@@ -74,17 +75,17 @@ cmd_finish() {
# sanity checks
gitflow_check_clean_working_tree
git fetch
origin
gitflow_require_branches_equal
master origin/master
gitflow_require_branches_equal
develop origin/develop
git fetch
$ORIGIN
gitflow_require_branches_equal
$MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
gitflow_require_branches_equal
$DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
# merge into master
git checkout
master
git checkout
$MASTER_BRANCH
git merge --no-ff $BRANCH
git tag v$VERSION
# merge into develop
git checkout
develop
git checkout
$DEVELOP_BRANCH
git merge --no-ff $BRANCH
# delete branch
...
...
@@ -95,10 +96,10 @@ cmd_finish() {
echo
echo "Summary of actions:"
echo "- Latest objects have been fetched from '
origin
'"
echo "- Release branch has been merged into '
master
'"
echo "- Latest objects have been fetched from '
$ORIGIN
'"
echo "- Release branch has been merged into '
$MASTER_BRANCH
'"
echo "- The release was tagged 'v$VERSION'"
echo "- Release branch has been back-merged into '
develop
'"
echo "- Release branch has been back-merged into '
$DEVELOP_BRANCH
'"
echo "- Release branch '$BRANCH' has been deleted"
echo
}
git-flow-support
View file @
d2240e40
...
...
@@ -24,7 +24,8 @@ parse_args() {
usage
exit 1
fi
BRANCH=support/$VERSION
PREFIX=$(git config --get gitflow.prefix.support || echo support/)
BRANCH=$PREFIX$VERSION
}
cmd_help() {
...
...
@@ -42,9 +43,9 @@ cmd_start() {
git checkout -b $BRANCH $BASE
# publish branch
git push
origin
$BRANCH:refs/heads/$BRANCH
git fetch
origin
git config branch.$BRANCH.remote
origin
git push
$ORIGIN
$BRANCH:refs/heads/$BRANCH
git fetch
$ORIGIN
git config branch.$BRANCH.remote
$ORIGIN
git config branch.$BRANCH.merge refs/heads/$BRANCH
git co $BRANCH
...
...
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