Skip to content
This repository
Browse code

make origin configurable

  • Loading branch information...
commit 350e7159f1b1e709bd71751f4c76f191884d098e 1 parent 4a864fb
Benedikt Böhm authored January 26, 2010
1  git-flow
@@ -21,6 +21,7 @@ fi
21 21
 export GITFLOW_DIR=$(dirname "$0")
22 22
 export MASTER_BRANCH=$(git config --get gitflow.branch.master || echo master)
23 23
 export DEVELOP_BRANCH=$(git config --get gitflow.branch.develop || echo develop)
  24
+export ORIGIN=$(git config --get gitflow.origin || echo origin)
24 25
 
25 26
 warn() { echo "$@" >&2; }
26 27
 die() { warn "$@"; exit 1; }
30  git-flow-feature
@@ -55,8 +55,8 @@ cmd_start() {
55 55
 	gitflow_check_clean_working_tree
56 56
 	gitflow_require_branch_absent $BRANCH
57 57
 	if [ "$BASE" = "$DEVELOP_BRANCH" ]; then
58  
-		git fetch origin $DEVELOP_BRANCH
59  
-		gitflow_require_branches_equal $DEVELOP_BRANCH origin/$DEVELOP_BRANCH
  58
+		git fetch $ORIGIN $DEVELOP_BRANCH
  59
+		gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
60 60
 	fi
61 61
 
62 62
 	# create branch
@@ -79,12 +79,12 @@ cmd_finish() {
79 79
 	# sanity checks
80 80
 	gitflow_check_clean_working_tree
81 81
 	gitflow_require_branch $BRANCH
82  
-	git fetch origin
83  
-	if has origin/$BRANCH $REMOTE_BRANCHES; then
84  
-		gitflow_require_branches_equal $BRANCH origin/$BRANCH
  82
+	git fetch $ORIGIN
  83
+	if has $ORIGIN/$BRANCH $REMOTE_BRANCHES; then
  84
+		gitflow_require_branches_equal $BRANCH $ORIGIN/$BRANCH
85 85
 	fi
86 86
 	if [ "$BASE" = "$DEVELOP_BRANCH" ]; then
87  
-		gitflow_require_branches_equal $DEVELOP_BRANCH origin/$DEVELOP_BRANCH
  87
+		gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
88 88
 	fi
89 89
 
90 90
 	# merge into BASE
@@ -97,7 +97,7 @@ cmd_finish() {
97 97
 
98 98
 	# delete branch
99 99
 	# TODO: How do we handle merge conflicts here??
100  
-	git push origin :refs/heads/$BRANCH
  100
+	git push $ORIGIN :refs/heads/$BRANCH
101 101
 	git branch -d $BRANCH
102 102
 
103 103
 	echo
@@ -115,15 +115,15 @@ cmd_publish() {
115 115
 	# sanity checks
116 116
 	gitflow_check_clean_working_tree
117 117
 	gitflow_require_branch $BRANCH
118  
-	git fetch origin
119  
-	gitflow_require_branch_absent origin/$BRANCH
  118
+	git fetch $ORIGIN
  119
+	gitflow_require_branch_absent $ORIGIN/$BRANCH
120 120
 
121 121
 	# create remote branch
122  
-	git push origin $BRANCH:refs/heads/$BRANCH
123  
-	git fetch origin
  122
+	git push $ORIGIN $BRANCH:refs/heads/$BRANCH
  123
+	git fetch $ORIGIN
124 124
 
125 125
 	# configure remote tracking
126  
-	git config branch.$BRANCH.remote origin
  126
+	git config branch.$BRANCH.remote $ORIGIN
127 127
 	git config branch.$BRANCH.merge refs/heads/$BRANCH
128 128
 	git checkout $BRANCH
129 129
 
@@ -141,11 +141,11 @@ cmd_track() {
141 141
 	# sanity checks
142 142
 	gitflow_check_clean_working_tree
143 143
 	gitflow_require_branch_absent $BRANCH
144  
-	git fetch origin
145  
-	gitflow_require_branch origin/$BRANCH
  144
+	git fetch $ORIGIN
  145
+	gitflow_require_branch $ORIGIN/$BRANCH
146 146
 
147 147
 	# create tracking branch
148  
-	git checkout -b $BRANCH origin/$BRANCH
  148
+	git checkout -b $BRANCH $ORIGIN/$BRANCH
149 149
 
150 150
 	echo
151 151
 	echo "Summary of actions:"
14  git-flow-hotfix
@@ -48,8 +48,8 @@ cmd_start() {
48 48
 
49 49
 	# sanity checks
50 50
 	gitflow_check_clean_working_tree
51  
-	git fetch origin
52  
-	gitflow_require_branches_equal $MASTER_BRANCH origin/$MASTER_BRANCH
  51
+	git fetch $ORIGIN
  52
+	gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
53 53
 	gitflow_require_branch_absent $BRANCH
54 54
 
55 55
 	# create branch
@@ -74,10 +74,10 @@ cmd_finish() {
74 74
 
75 75
 	# sanity checks
76 76
 	gitflow_check_clean_working_tree
77  
-	git fetch origin $MASTER_BRANCH
78  
-	git fetch origin $DEVELOP_BRANCH
79  
-	gitflow_require_branches_equal $MASTER_BRANCH origin/$MASTER_BRANCH
80  
-	gitflow_require_branches_equal $DEVELOP_BRANCH origin/$DEVELOP_BRANCH
  77
+	git fetch $ORIGIN $MASTER_BRANCH
  78
+	git fetch $ORIGIN $DEVELOP_BRANCH
  79
+	gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
  80
+	gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
81 81
 
82 82
 	# merge into BASE
83 83
 	git checkout $BASE
@@ -99,7 +99,7 @@ cmd_finish() {
99 99
 
100 100
 	echo
101 101
 	echo "Summary of actions:"
102  
-	echo "- Latest objects have been fetched from 'origin'"
  102
+	echo "- Latest objects have been fetched from '$ORIGIN'"
103 103
 	echo "- Hotfix branch has been merged into '$BASE'"
104 104
 	echo "- The hotfix was tagged 'v$VERSION'"
105 105
 	if [ "$BASE" = "$MASTER_BRANCH" ]; then
12  git-flow-release
@@ -48,8 +48,8 @@ cmd_start() {
48 48
 
49 49
 	# sanity checks
50 50
 	gitflow_check_clean_working_tree
51  
-	git fetch origin
52  
-	gitflow_require_branches_equal $DEVELOP_BRANCH origin/$DEVELOP_BRANCH
  51
+	git fetch $ORIGIN
  52
+	gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
53 53
 	gitflow_require_branch_absent $BRANCH
54 54
 
55 55
 	# create branch
@@ -74,9 +74,9 @@ cmd_finish() {
74 74
 
75 75
 	# sanity checks
76 76
 	gitflow_check_clean_working_tree
77  
-	git fetch origin
78  
-	gitflow_require_branches_equal $MASTER_BRANCH origin/$MASTER_BRANCH
79  
-	gitflow_require_branches_equal $DEVELOP_BRANCH origin/$DEVELOP_BRANCH
  77
+	git fetch $ORIGIN
  78
+	gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
  79
+	gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
80 80
 
81 81
 	# merge into master
82 82
 	git checkout $MASTER_BRANCH
@@ -95,7 +95,7 @@ cmd_finish() {
95 95
 
96 96
 	echo
97 97
 	echo "Summary of actions:"
98  
-	echo "- Latest objects have been fetched from 'origin'"
  98
+	echo "- Latest objects have been fetched from '$ORIGIN'"
99 99
 	echo "- Release branch has been merged into '$MASTER_BRANCH'"
100 100
 	echo "- The release was tagged 'v$VERSION'"
101 101
 	echo "- Release branch has been back-merged into '$DEVELOP_BRANCH'"
6  git-flow-support
@@ -42,9 +42,9 @@ cmd_start() {
42 42
 	git checkout -b $BRANCH $BASE
43 43
 
44 44
 	# publish branch
45  
-	git push origin $BRANCH:refs/heads/$BRANCH
46  
-	git fetch origin
47  
-	git config branch.$BRANCH.remote origin
  45
+	git push $ORIGIN $BRANCH:refs/heads/$BRANCH
  46
+	git fetch $ORIGIN
  47
+	git config branch.$BRANCH.remote $ORIGIN
48 48
 	git config branch.$BRANCH.merge refs/heads/$BRANCH
49 49
 	git co $BRANCH
50 50
 

0 notes on commit 350e715

Please sign in to comment.
Something went wrong with that request. Please try again.