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
3227d802
Commit
3227d802
authored
Feb 20, 2010
by
Vincent Driessen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only switch to develop branch if it's newly created.
parent
131c2988
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
git-flow-init
git-flow-init
+7
-2
No files found.
git-flow-init
View file @
3227d802
...
...
@@ -144,9 +144,11 @@ cmd_default() {
# ----------------
# We create a HEAD now, if it does not exist yet (in a fresh repo). We need
# it to be able to create new branches.
local created_gitflow_branch=0
if ! git rev-parse --quiet --verify HEAD >/dev/null 2>&1; then
git symbolic-ref HEAD "refs/heads/$master_branch"
git commit --allow-empty --quiet -m "Initial commit"
created_gitflow_branch=1
fi
# Creation of master
...
...
@@ -163,13 +165,16 @@ cmd_default() {
# the develop branch now in that case (we base it on master, of course)
if ! gitflow_local_branch_exists "$develop_branch"; then
git branch "$develop_branch" "$master_branch"
created_gitflow_branch=1
fi
# assert the gitflow repo has been correctly initialized
gitflow_is_initialized
# checkout the develop branch to start working
# switch to develop branch if its newly created
if [ $created_gitflow_branch -eq 1 ]; then
git checkout -q "$develop_branch"
fi
# TODO: finally, ask the user for naming convention preferences
# i.e. tag prefixes, prefixes for supporting branches, etc.
...
...
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