# Contradicting man page for git branch copy

2 messages from 2021-10-23 to 2021-10-23. Participants: Martin, Junio C Hamano.
Thread: https://gitlist.dev/t/56768

## Martin, 2021-10-23 15:25

Subject: Contradicting man page for git branch copy
Message-ID: <7a600f7e-e3a7-edac-056c-9639ff01e471@mfriebe.de>
URL: https://gitlist.dev/e/7a600f7e-e3a7-edac-056c-9639ff01e471%40mfriebe.de

```
The man page says

1) Under "Description"
https://git-scm.com/docs/git-branch#_description
> The |-c| and |-C| options have the exact same semantics as |-m| and 
> |-M|, except instead of the branch being renamed, it will be copied to 
> a new name, along with its config and reflog.

But on the option itself
https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--c
>
> -c
> --copy
>
>     Copy a branch and the corresponding reflog.
>

The latter does not mention the config.

So does it copy the config or not ?




```

## Junio C Hamano, 2021-10-23 23:57

Subject: Re* Contradicting man page for git branch copy
Message-ID: <xmqq5ytn8fbp.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq5ytn8fbp.fsf%40gitster.g
In-Reply-To: <7a600f7e-e3a7-edac-056c-9639ff01e471@mfriebe.de>

```
Martin <git@mfriebe.de> writes:

> The man page says
>
> 1) Under "Description"
> https://git-scm.com/docs/git-branch#_description
>> The |-c| and |-C| options have the exact same semantics as |-m| and
>> |-M|, except instead of the branch being renamed, it will be copied
>> to a new name, along with its config and reflog.
>
> But on the option itself
> https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--c
>>
>> -c
>> --copy
>>
>>     Copy a branch and the corresponding reflog.
>>
>
> The latter does not mention the config.
>
> So does it copy the config or not ?

Thanks for a report.  

I hope that builtin/branch.c::copy_or_rename_branch() is a
relatively easy read.

----- >8 --------- >8 --------- >8 --------- >8 -----
Subject: branch (doc): -m/-c copies config and reflog

The description section for the command mentions config and reflog
are moved or copied by these options, but the description for these
options did not.  Make them match.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/git-branch.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git i/Documentation/git-branch.txt w/Documentation/git-branch.txt
index 5449767121..8af42eff89 100644
--- i/Documentation/git-branch.txt
+++ w/Documentation/git-branch.txt
@@ -125,14 +125,14 @@ OPTIONS
 
 -m::
 --move::
-	Move/rename a branch and the corresponding reflog.
+	Move/rename a branch, together with its config and reflog.
 
 -M::
 	Shortcut for `--move --force`.
 
 -c::
 --copy::
-	Copy a branch and the corresponding reflog.
+	Copy a branch, together with its config and reflog.
 
 -C::
 	Shortcut for `--copy --force`.



```
