Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git create branch from another branch

# workflow, step by step:
git checkout srcBranch		# where new branch will be created from
git branch newBranch		# newBranch is created from srcBranch
git checkout newBranch		# switch from srcBranch to newBranch

# in a single line:
git checkout -b newBranch srcBranch
git checkout -b newBranch	# srcBranch is optional if already checked out
 
PREVIOUS NEXT
Tagged: #git #create #branch #branch
ADD COMMENT
Topic
Name
8+7 =