# Bug report

4 messages from 2024-07-19 to 2024-07-19. Participants: Roman Dvoskin, brian m. carlson, rsbecker@nexbridge.com.
Thread: https://gitlist.dev/t/61812

## Roman Dvoskin, 2024-07-19 18:34

Subject: Bug report
Message-ID: <CAKexjB-+6VXE8YXrc1YaOVE6bKs05Ty4XHMSBPRHUcUrxpp31w@mail.gmail.com>
URL: https://gitlist.dev/e/CAKexjB-%2B6VXE8YXrc1YaOVE6bKs05Ty4XHMSBPRHUcUrxpp31w%40mail.gmail.com

```



Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
I renamed an existing branch to a new name
What did you expect to happen? (Expected behavior)
When I git push I expected the new name to be used to match the remote branch
What happened instead? (Actual behavior)
I was prompted to use git push HEAD:<old_branch_name>
What's different between what you expected and what actually happened?
I expected for the new branch name to be used, as if it was always the branch name
Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.39.3 (Apple Git-146)
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64
compiler info: clang: 15.0.0 (clang-1500.3.9.4)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]
pre-commit

```

## brian m. carlson, 2024-07-19 20:13

Subject: Re: Bug report
Message-ID: <ZprI_wP1km8eA7HA@tapette.crustytoothpaste.net>
URL: https://gitlist.dev/e/ZprI_wP1km8eA7HA%40tapette.crustytoothpaste.net
In-Reply-To: <CAKexjB-+6VXE8YXrc1YaOVE6bKs05Ty4XHMSBPRHUcUrxpp31w@mail.gmail.com>

```
Hey,

On 2024-07-19 at 18:34:29, Roman Dvoskin wrote:
> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.
> 
> What did you do before the bug happened? (Steps to reproduce your issue)
> I renamed an existing branch to a new name
> What did you expect to happen? (Expected behavior)
> When I git push I expected the new name to be used to match the remote branch
> What happened instead? (Actual behavior)
> I was prompted to use git push HEAD:<old_branch_name>
> What's different between what you expected and what actually happened?
> I expected for the new branch name to be used, as if it was always the branch name
> Anything else you want to add:

I'm not sure I understand exactly the message that you saw here, and I
suspect if I don't understand, it's possible other people on the list
don't either. Could you copy and paste the exact output you saw here so
that we can see what the prompt looks like and the exact response you
saw? That would help us understand whether the behaviour you saw is a
bug or not, or if perhaps maybe the documentation is unclear.

Also, to be sure I understand, you did something like this:

----
git branch -m foo bar
git push origin bar
----

and you expected the local branch `bar` to be pushed to the remote branch
`bar`, correct?
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA

```

## Roman Dvoskin, 2024-07-19 20:35

Subject: Re: Bug report
Message-ID: <CAKexjB_kya5ux+OZPXVumwxVt9HWD2v3TMF7aFbMxXzYYV_t=A@mail.gmail.com>
URL: https://gitlist.dev/e/CAKexjB_kya5ux%2BOZPXVumwxVt9HWD2v3TMF7aFbMxXzYYV_t%3DA%40mail.gmail.com
In-Reply-To: <ZprI_wP1km8eA7HA@tapette.crustytoothpaste.net>

```
Hi Brian,

Yes, you're exactly right, I renamed the branch called PLT-51 to
PLT-50-2 via `git branch -m PLT-50-2`. I may have pushed while on
PLT-51 (and perhaps that's when I noticed that I mis-named the branch)
but I did not create a PR). Then, I renamed the branch to PLT-50-2 and
expected the rest of the flow to continue using the new branch name.

rdvoskin@MT-24 platform % git push

fatal: The upstream branch of your current branch does not match

the name of your current branch.  To push to the upstream branch

on the remote, use



    git push origin HEAD:PLT-51



To push to the branch of the same name on the remote, use



    git push origin HEAD



To avoid automatically configuring an upstream branch when its name

won't match the local branch, see option 'simple' of branch.autoSetupMerge

in 'git help config'.



rdvoskin@MT-24 platform % git push origin HEAD

Enumerating objects: 27, done.

Counting objects: 100% (27/27), done.

Delta compression using up to 16 threads

Compressing objects: 100% (14/14), done.

Writing objects: 100% (14/14), 2.91 KiB | 993.00 KiB/s, done.

Total 14 (delta 12), reused 0 (delta 0), pack-reused 0

remote: Resolving deltas: 100% (12/12), completed with 12 local objects.

To github.com:MyTechnologiesOrg/platform.git

   9b7fc2a..b66bee8  HEAD -> PLT-50-2

rdvoskin@MT-24 platform % git config --global push.default
simple


On Fri, Jul 19, 2024 at 4:13 PM brian m. carlson
<sandals@crustytoothpaste.net> wrote:
>
> Hey,
>
> On 2024-07-19 at 18:34:29, Roman Dvoskin wrote:
> > Thank you for filling out a Git bug report!
> > Please answer the following questions to help us understand your issue.
> >
> > What did you do before the bug happened? (Steps to reproduce your issue)
> > I renamed an existing branch to a new name
> > What did you expect to happen? (Expected behavior)
> > When I git push I expected the new name to be used to match the remote branch
> > What happened instead? (Actual behavior)
> > I was prompted to use git push HEAD:<old_branch_name>
> > What's different between what you expected and what actually happened?
> > I expected for the new branch name to be used, as if it was always the branch name
> > Anything else you want to add:
>
> I'm not sure I understand exactly the message that you saw here, and I
> suspect if I don't understand, it's possible other people on the list
> don't either. Could you copy and paste the exact output you saw here so
> that we can see what the prompt looks like and the exact response you
> saw? That would help us understand whether the behaviour you saw is a
> bug or not, or if perhaps maybe the documentation is unclear.
>
> Also, to be sure I understand, you did something like this:
>
> ----
> git branch -m foo bar
> git push origin bar
> ----
>
> and you expected the local branch `bar` to be pushed to the remote branch
> `bar`, correct?
> --
> brian m. carlson (they/them or he/him)
> Toronto, Ontario, CA

```

## rsbecker@nexbridge.com, 2024-07-19 20:40

Subject: RE: Bug report
Message-ID: <019001dada1b$f5a822e0$e0f868a0$@nexbridge.com>
URL: https://gitlist.dev/e/019001dada1b%24f5a822e0%24e0f868a0%24%40nexbridge.com
In-Reply-To: <ZprI_wP1km8eA7HA@tapette.crustytoothpaste.net>

```
On Friday, July 19, 2024 4:14 PM, brian m. carlson wrote:
>On 2024-07-19 at 18:34:29, Roman Dvoskin wrote:
>> Thank you for filling out a Git bug report!
>> Please answer the following questions to help us understand your issue.
>>
>> What did you do before the bug happened? (Steps to reproduce your
>> issue) I renamed an existing branch to a new name What did you expect
>> to happen? (Expected behavior) When I git push I expected the new name
>> to be used to match the remote branch What happened instead? (Actual
>> behavior) I was prompted to use git push HEAD:<old_branch_name> What's
>> different between what you expected and what actually happened?
>> I expected for the new branch name to be used, as if it was always the
>> branch name Anything else you want to add:
>
>I'm not sure I understand exactly the message that you saw here, and I suspect if I
>don't understand, it's possible other people on the list don't either. Could you copy
>and paste the exact output you saw here so that we can see what the prompt looks
>like and the exact response you saw? That would help us understand whether the
>behaviour you saw is a bug or not, or if perhaps maybe the documentation is
>unclear.
>
>Also, to be sure I understand, you did something like this:
>
>----
>git branch -m foo bar
>git push origin bar
>----
>
>and you expected the local branch `bar` to be pushed to the remote branch `bar`,
>correct?

Would not the logical way to do this be:
git switch -c foo # Or however the branch is set up.
git push --set-upstream origin bar   # Sets the association to the remote branch

I could not get the original attachment (filtered out).


```
