Skip to content

Commit dc1c22c

Browse files
committed
fix create branch example in docs
fixes #1230
1 parent ffe28ac commit dc1c22c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/branches.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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')

0 commit comments

Comments
 (0)