make origin configurable
diff --git a/git-flow b/git-flow
index 0adac5c..283c779 100755
--- a/git-flow
+++ b/git-flow
@@ -21,6 +21,7 @@
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; }
diff --git a/git-flow-feature b/git-flow-feature
index b48e893..cda9c90 100755
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -55,8 +55,8 @@
gitflow_check_clean_working_tree
gitflow_require_branch_absent $BRANCH
if [ "$BASE" = "$DEVELOP_BRANCH" ]; then
- git fetch origin $DEVELOP_BRANCH
- gitflow_require_branches_equal $DEVELOP_BRANCH origin/$DEVELOP_BRANCH
+ git fetch $ORIGIN $DEVELOP_BRANCH
+ gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
fi
# create branch
@@ -79,12 +79,12 @@
# 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_BRANCH" ]; then
- gitflow_require_branches_equal $DEVELOP_BRANCH origin/$DEVELOP_BRANCH
+ gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
fi
# merge into BASE
@@ -97,7 +97,7 @@
# 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 +115,15 @@
# 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 +141,11 @@
# 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:"
diff --git a/git-flow-hotfix b/git-flow-hotfix
index d5542f8..a12619c 100755
--- a/git-flow-hotfix
+++ b/git-flow-hotfix
@@ -48,8 +48,8 @@
# sanity checks
gitflow_check_clean_working_tree
- git fetch origin
- gitflow_require_branches_equal $MASTER_BRANCH origin/$MASTER_BRANCH
+ git fetch $ORIGIN
+ gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
gitflow_require_branch_absent $BRANCH
# create branch
@@ -74,10 +74,10 @@
# sanity checks
gitflow_check_clean_working_tree
- 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
+ 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
@@ -99,7 +99,7 @@
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_BRANCH" ]; then
diff --git a/git-flow-release b/git-flow-release
index 35b4fbe..ca5e360 100755
--- a/git-flow-release
+++ b/git-flow-release
@@ -48,8 +48,8 @@
# sanity checks
gitflow_check_clean_working_tree
- git fetch origin
- gitflow_require_branches_equal $DEVELOP_BRANCH origin/$DEVELOP_BRANCH
+ git fetch $ORIGIN
+ gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
gitflow_require_branch_absent $BRANCH
# create branch
@@ -74,9 +74,9 @@
# sanity checks
gitflow_check_clean_working_tree
- git fetch origin
- gitflow_require_branches_equal $MASTER_BRANCH origin/$MASTER_BRANCH
- gitflow_require_branches_equal $DEVELOP_BRANCH origin/$DEVELOP_BRANCH
+ 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_BRANCH
@@ -95,7 +95,7 @@
echo
echo "Summary of actions:"
- echo "- Latest objects have been fetched from 'origin'"
+ 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_BRANCH'"
diff --git a/git-flow-support b/git-flow-support
index a3fc91e..c48e357 100644
--- a/git-flow-support
+++ b/git-flow-support
@@ -42,9 +42,9 @@
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