File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,14 @@ Example::
2626 >>> remote_branches = list(repo.branches.remote)
2727
2828 >>> # Get a branch
29- >>> branch = repo.branches['master']
29+ >>> master_branch = repo.branches['master']
3030 >>> other_branch = repo.branches['does-not-exist'] # Will raise a KeyError
3131 >>> other_branch = repo.branches.get('does-not-exist') # Returns None
3232
3333 >>> remote_branch = repo.branches.remote['upstream/feature']
3434
35- >>> # Create a local branch
36- >>> new_branch = repo.branches.local.create('new-branch')
35+ >>> # Create a local branch, branching from master
36+ >>> new_branch = repo.branches.local.create('new-branch', repo[master_branch.target] )
3737
3838 >>> And delete it
3939 >>> repo.branches.delete('new-branch')
You can’t perform that action at this time.
0 commit comments