fork-dev / Tracker

Bug and issue tracker for Fork for Mac
495 stars 12 forks source link

renamed branch is pushed to the old name #2052

Closed kambala-decapitator closed 4 months ago

kambala-decapitator commented 5 months ago

To reproduce:

  1. Checkout some branch. In my case I did it from a newly added remote.
  2. Rename the branch locally
  3. Open the push dialog - the To field shows the old branch name (before renaming)

Screenshot 2024-01-23 at 09 09 45

DanPristupov commented 5 months ago
  1. I can't reproduce the problem.

  2. Check the operation output in the activity manager (Click on the Repository name on the toolbar). It must contain the details.

  3. Rename the branch locally

Did you enable 'Also rename $upstream'?

Screenshot 2024-01-23 at 8 44 51
kambala-decapitator commented 5 months ago

Did you enable 'Also rename $upstream'?

no, I don't have write access to upstream, so I didn't enable that.

from the activity manager:

$ git fetch --prune --tags --all --verbose
...
From https://github.com/integralpro/Official-Kodi-Remote-iOS
 * [new branch]        Catalan_translation → watch/Catalan_translation
 * [new branch]        Hebrew_translation  → watch/Hebrew_translation
 * [new branch]        master              → watch/master
 * [new branch]        watchapp            → watch/watchapp
$ git checkout --track -b watchapp watch/watchapp

branch 'watchapp' set up to track 'watch/watchapp'.

Switched to a new branch 'watchapp'
$ git branch -m watchapp watchapp-91
$ git push origin refs/heads/watchapp-91 --tags --verbose

Pushing to github.com:kambala-decapitator/Official-Kodi-Remote-iOS.git
Enumerating objects: 408, done.
Delta compression using up to 6 threads
Total 269 (delta 146), reused 206 (delta 103), pack-reused 0
To github.com:kambala-decapitator/Official-Kodi-Remote-iOS.git
 = [up to date]        1.10 → 1.10
 = [up to date]        1.10-b1 → 1.10-b1
 = [up to date]        1.10-b10 → 1.10-b10
 = [up to date]        1.10-b2 → 1.10-b2
 = [up to date]        1.10-b3 → 1.10-b3
 = [up to date]        1.10-b4 → 1.10-b4
 = [up to date]        1.10-b5 → 1.10-b5
 = [up to date]        1.10-b6 → 1.10-b6
 = [up to date]        1.10-b7 → 1.10-b7
 = [up to date]        1.10-b8 → 1.10-b8
 = [up to date]        1.10-b9 → 1.10-b9
 = [up to date]        1.10.1 → 1.10.1
 = [up to date]        1.10.1-b1 → 1.10.1-b1
 = [up to date]        1.10.1-b2 → 1.10.1-b2
 = [up to date]        1.11 → 1.11
 = [up to date]        1.11-b1 → 1.11-b1
 = [up to date]        1.11-b10 → 1.11-b10
 = [up to date]        1.11-b11 → 1.11-b11
 = [up to date]        1.11-b2 → 1.11-b2
 = [up to date]        1.11-b3 → 1.11-b3
 = [up to date]        1.11-b4 → 1.11-b4
 = [up to date]        1.11-b5 → 1.11-b5
 = [up to date]        1.11-b6 → 1.11-b6
 = [up to date]        1.11-b7 → 1.11-b7
 = [up to date]        1.11-b8 → 1.11-b8
 = [up to date]        1.11-b9 → 1.11-b9
 = [up to date]        1.11.1-b1 → 1.11.1-b1
 = [up to date]        1.11.1-b2 → 1.11.1-b2
 = [up to date]        1.11.1-b3 → 1.11.1-b3
 = [up to date]        1.11.1-b4 → 1.11.1-b4
 = [up to date]        1.11.1-b5 → 1.11.1-b5
 = [up to date]        1.11.1-b6 → 1.11.1-b6
 = [up to date]        1.11.1-b7 → 1.11.1-b7
 = [up to date]        1.11.1-b8 → 1.11.1-b8
 = [up to date]        1.12 → 1.12
 = [up to date]        1.12-b10 → 1.12-b10
 = [up to date]        1.12-b11 → 1.12-b11
 = [up to date]        1.12-b9 → 1.12-b9
 = [up to date]        1.12.1 → 1.12.1
 = [up to date]        1.12.1-b1 → 1.12.1-b1
 = [up to date]        1.13 → 1.13
 = [up to date]        1.13-b1 → 1.13-b1
 = [up to date]        1.13-b10 → 1.13-b10
 = [up to date]        1.13-b11 → 1.13-b11
 = [up to date]        1.13-b12 → 1.13-b12
 = [up to date]        1.13-b2 → 1.13-b2
 = [up to date]        1.13-b3 → 1.13-b3
 = [up to date]        1.13-b4 → 1.13-b4
 = [up to date]        1.13-b5 → 1.13-b5
 = [up to date]        1.13-b6 → 1.13-b6
 = [up to date]        1.13-b7 → 1.13-b7
 = [up to date]        1.13-b8 → 1.13-b8
 = [up to date]        1.13-b9 → 1.13-b9
 = [up to date]        1.13.1 → 1.13.1
 = [up to date]        1.13.1-b1 → 1.13.1-b1
 = [up to date]        1.13.1-b2 → 1.13.1-b2
 = [up to date]        1.14-b1 → 1.14-b1
 = [up to date]        1.6 → 1.6
 = [up to date]        1.6.1 → 1.6.1
 = [up to date]        1.6.2 → 1.6.2
 = [up to date]        1.6.2-b1 → 1.6.2-b1
 = [up to date]        1.6.2-b10 → 1.6.2-b10
 = [up to date]        1.6.2-b2 → 1.6.2-b2
 = [up to date]        1.6.2-b3 → 1.6.2-b3
 = [up to date]        1.6.2-b4 → 1.6.2-b4
 = [up to date]        1.6.2-b5 → 1.6.2-b5
 = [up to date]        1.6.2-b6 → 1.6.2-b6
 = [up to date]        1.6.2-b7 → 1.6.2-b7
 = [up to date]        1.6.2-b8 → 1.6.2-b8
 = [up to date]        1.6.2-b9 → 1.6.2-b9
 = [up to date]        1.7 → 1.7
 = [up to date]        1.7-b1 → 1.7-b1
 = [up to date]        1.7-b2 → 1.7-b2
 = [up to date]        1.7-b3 → 1.7-b3
 = [up to date]        1.7-b4 → 1.7-b4
 = [up to date]        1.7-b5 → 1.7-b5
 = [up to date]        1.7-b6 → 1.7-b6
 = [up to date]        1.7.1 → 1.7.1
 = [up to date]        1.7.1-b1 → 1.7.1-b1
 = [up to date]        1.7.1-b2 → 1.7.1-b2
 = [up to date]        1.7.1-b3 → 1.7.1-b3
 = [up to date]        1.7.2-b1 → 1.7.2-b1
 = [up to date]        1.7.2-b10 → 1.7.2-b10
 = [up to date]        1.7.2-b11 → 1.7.2-b11
 = [up to date]        1.7.2-b12 → 1.7.2-b12
 = [up to date]        1.7.2-b2 → 1.7.2-b2
 = [up to date]        1.7.2-b3 → 1.7.2-b3
 = [up to date]        1.7.2-b4 → 1.7.2-b4
 = [up to date]        1.7.2-b5 → 1.7.2-b5
 = [up to date]        1.7.2-b6 → 1.7.2-b6
 = [up to date]        1.7.2-b7 → 1.7.2-b7
 = [up to date]        1.7.2-b8 → 1.7.2-b8
 = [up to date]        1.7.2-b9 → 1.7.2-b9
 = [up to date]        1.8 → 1.8
 = [up to date]        1.8-b13 → 1.8-b13
 = [up to date]        1.8-b14 → 1.8-b14
 = [up to date]        1.8.1 → 1.8.1
 = [up to date]        1.8.1-b1 → 1.8.1-b1
 = [up to date]        1.8.1-b2 → 1.8.1-b2
 = [up to date]        1.8.2-b1 → 1.8.2-b1
 = [up to date]        1.8.2-b2 → 1.8.2-b2
 = [up to date]        1.8.2-b3 → 1.8.2-b3
 = [up to date]        1.8.2-b4 → 1.8.2-b4
 = [up to date]        1.8.2-b5 → 1.8.2-b5
 = [up to date]        1.8.2-b6 → 1.8.2-b6
 = [up to date]        1.8.2-b7 → 1.8.2-b7
 = [up to date]        1.8.2-b8 → 1.8.2-b8
 = [up to date]        1.8.2-b9 → 1.8.2-b9
 = [up to date]        1.9 → 1.9
 = [up to date]        1.9-b10 → 1.9-b10
 = [up to date]        1.9-b11 → 1.9-b11
 * [new branch]        watchapp-91 → watchapp
 * [new tag]           1.14-b2 → 1.14-b2
updating local tracking ref 'refs/remotes/origin/watchapp'
DanPristupov commented 5 months ago

no, I don't have write access to upstream, so I didn't enable that.

I don't understand the issue then.

P.S. You can check remote tracking reference in the local branch tooltip on the sidebar.

DanPristupov commented 5 months ago

If your original intention was to change remote tracking reference by renaming local branch, it's wrong.

Local branch is independent from the remote branch, but may link to one using remote tracking reference (upstream). Upstream can be changed in the local branch context menu on the sidebar.

kambala-decapitator commented 5 months ago

I wanted to push local branch to a different remote. Since the target remote doesn't have such branch yet, I don't understand why it's using branch name from the original remote and not the local branch name. I'd expect exactly the same behavior as in the case when you create fresh local branch: on push the new target branch is set to the same name as the local one.

Upstream can be changed in the local branch context menu on the sidebar.

it's not possible to do when upstream branch doesn't exist yet which is exactly my case

kambala-decapitator commented 5 months ago

to clarify: I checked the branch out from remote A, renamed the local branch and trying to push it to remote B under the new name.

DanPristupov commented 4 months ago

It took some time to check that.

To reproduce:

Checkout some branch. In my case I did it from a newly added remote. Rename the branch locally Open the push dialog - the To field shows the old branch name (before renaming)

I think this is correct because the remote tracking reference (upstream) is still the same.

If you want to push to some other name, you must select Custom... option in the dropdown, which should use the default branch name by default.

kambala-decapitator commented 4 months ago

Thank you very much! Now I got it. Let's close then.