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
9283eaef
Commit
9283eaef
authored
Jan 02, 2012
by
Vincent Driessen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some example hook scripts.
parent
359db205
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
0 deletions
+99
-0
git-flow-feature
git-flow-feature
+17
-0
pre-flow-feature-finish
hooks/pre-flow-feature-finish
+16
-0
pre-flow-feature-publish
hooks/pre-flow-feature-publish
+16
-0
pre-flow-feature-pull
hooks/pre-flow-feature-pull
+16
-0
pre-flow-feature-start
hooks/pre-flow-feature-start
+18
-0
pre-flow-feature-track
hooks/pre-flow-feature-track
+16
-0
No files found.
git-flow-feature
View file @
9283eaef
...
...
@@ -211,11 +211,15 @@ cmd_start() {
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
fi
run_pre_hook "$NAME" "$ORIGIN" "$BRANCH" "$BASE"
# create branch
if ! git checkout -b "$BRANCH" "$BASE"; then
die "Could not create feature branch '$BRANCH'"
fi
run_post_hook "$NAME" "$ORIGIN" "$BRANCH" "$BASE"
echo
echo "Summary of actions:"
echo "- A new branch '$BRANCH' was created, based on '$BASE'"
...
...
@@ -296,6 +300,8 @@ cmd_finish() {
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
fi
run_pre_hook "$NAME" "$ORIGIN" "$BRANCH"
# if the user wants to rebase, do that first
if flag rebase; then
if ! git flow feature rebase "$NAME" "$DEVELOP_BRANCH"; then
...
...
@@ -331,6 +337,8 @@ cmd_finish() {
exit 1
fi
run_post_hook "$NAME" "$ORIGIN" "$BRANCH"
# when no merge conflict is detected, just clean up the feature branch
helper_finish_cleanup
}
...
...
@@ -377,6 +385,8 @@ cmd_publish() {
git fetch -q "$ORIGIN"
require_branch_absent "$ORIGIN/$BRANCH"
run_pre_hook "$NAME" "$ORIGIN" "$BRANCH"
# create remote branch
git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH"
git fetch -q "$ORIGIN"
...
...
@@ -386,6 +396,8 @@ cmd_publish() {
git config "branch.$BRANCH.merge" "refs/heads/$BRANCH"
git checkout "$BRANCH"
run_post_hook "$NAME" "$ORIGIN" "$BRANCH"
echo
echo "Summary of actions:"
echo "- A new remote branch '$BRANCH' was created"
...
...
@@ -401,12 +413,17 @@ cmd_track() {
# sanity checks
require_clean_working_tree
require_branch_absent "$BRANCH"
run_pre_hook "$NAME" "$ORIGIN" "$BRANCH"
git fetch -q "$ORIGIN"
require_branch "$ORIGIN/$BRANCH"
# create tracking branch
git checkout -b "$BRANCH" "$ORIGIN/$BRANCH"
run_post_hook "$NAME" "$ORIGIN" "$BRANCH"
echo
echo "Summary of actions:"
echo "- A new remote tracking branch '$BRANCH' was created"
...
...
hooks/pre-flow-feature-finish
0 → 100755
View file @
9283eaef
#!/bin/sh
#
# Ran before git flow feature finish
#
# Positional arguments:
# $1 The friendly name of the branch
# $2 The origin remote
# $3 The full branch name (including the feature prefix)
#
NAME
=
$1
ORIGIN
=
$2
BRANCH
=
$3
# Implement your script here.
# To terminate the git-flow action, return a non-zero exit code.
exit
0
hooks/pre-flow-feature-publish
0 → 100755
View file @
9283eaef
#!/bin/sh
#
# Ran before git flow feature publish
#
# Positional arguments:
# $1 The friendly name of the branch
# $2 The origin remote
# $3 The full branch name (including the feature prefix)
#
NAME
=
$1
ORIGIN
=
$2
BRANCH
=
$3
# Implement your script here.
# To terminate the git-flow action, return a non-zero exit code.
exit
0
hooks/pre-flow-feature-pull
0 → 100755
View file @
9283eaef
#!/bin/sh
#
# Ran before git flow feature pull.
#
# Positional arguments:
# $1 The friendly name of the branch
# $2 The remote to pull from
# $3 The full branch name (including the feature prefix)
#
NAME
=
$1
REMOTE
=
$2
BRANCH
=
$3
# Implement your script here.
# To terminate the git-flow action, return a non-zero exit code.
exit
0
hooks/pre-flow-feature-start
0 → 100755
View file @
9283eaef
#!/bin/sh
#
# Ran before git flow feature start
#
# Positional arguments:
# $1 The friendly name of the branch
# $2 The origin remote
# $3 The full branch name (including the feature prefix)
# $4 The base from which this feature is started
#
NAME
=
$1
ORIGIN
=
$2
BRANCH
=
$3
BASE
=
$4
# Implement your script here.
# To terminate the git-flow action, return a non-zero exit code.
exit
0
hooks/pre-flow-feature-track
0 → 100755
View file @
9283eaef
#!/bin/sh
#
# Ran before git flow feature track
#
# Positional arguments:
# $1 The friendly name of the branch
# $2 The origin remote
# $3 The full branch name (including the feature prefix)
#
NAME
=
$1
ORIGIN
=
$2
BRANCH
=
$3
# Implement your script here.
# To terminate the git-flow action, return a non-zero exit code.
exit
0
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