From dc1c22cc48ea639fff26a6c86b2c59300791b568 Mon Sep 17 00:00:00 2001 From: Benedikt Seidl Date: Sat, 26 Jul 2025 19:01:19 +0200 Subject: [PATCH] fix create branch example in docs fixes #1230 --- docs/branches.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/branches.rst b/docs/branches.rst index f98d9baaa..5afe6673e 100644 --- a/docs/branches.rst +++ b/docs/branches.rst @@ -26,14 +26,14 @@ Example:: >>> remote_branches = list(repo.branches.remote) >>> # Get a branch - >>> branch = repo.branches['master'] + >>> master_branch = repo.branches['master'] >>> other_branch = repo.branches['does-not-exist'] # Will raise a KeyError >>> other_branch = repo.branches.get('does-not-exist') # Returns None >>> remote_branch = repo.branches.remote['upstream/feature'] - >>> # Create a local branch - >>> new_branch = repo.branches.local.create('new-branch') + >>> # Create a local branch, branching from master + >>> new_branch = repo.branches.local.create('new-branch', repo[master_branch.target]) >>> And delete it >>> repo.branches.delete('new-branch')