Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream branch name not respected when pushing #1981

Open
HenrikPoulsen opened this issue Nov 14, 2024 · 1 comment
Open

Upstream branch name not respected when pushing #1981

HenrikPoulsen opened this issue Nov 14, 2024 · 1 comment
Assignees

Comments

@HenrikPoulsen
Copy link

Version info

  • OS: Fedora 41
  • Build: 2102

Description

So I have a repository which is forked and locally I have main for the original repo, and I created a main-fork from the forked repo.
I wanted to then push main-fork to the remote fork with the branch name main.
I had done "Set upstream..." to the main branch. But then when I push it just ignores that and creates a fork-main branch on the fork remote.

You can see here that git says the upstream is set correctly:

$ git branch -vv
* fork-main ae848a4 [fork/main: ahead 6] Merge branch 'main' into fork-main

but it still pushes to fork/fork-main

Steps to reproduce

Steps to reproduce the behavior:

  1. Open a repository.
  2. Add a new remote called fork
  3. Make sure you have a local branch called main which tracks origin/main
  4. Now create a new local branch from fork/main called fork-main
  5. Check git -vv to make sure it indicates fork/main is the upstream. If not go to submlime merge and right click fork-main and use Set Upstream... to set it to fork/main and then check again
  6. Now just hit the push button (you don't need to make any commits to fork-main at all, it will still create fork/fork-main`)

Expected behavior

I would expect it to push to fork/main, but instead it creates fork/fork-main and pushes it there

Debug Information

=== App Version Information ===
Build: 2102

=== Git Version Information ===
Using Git: git (system)
git version 2.47.0
PATH: /home/me/.nvm/versions/node/v22.4.1/bin:/home/me/.local/bin:/home/me/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin:/usr/local/go/bin:/home/me/.dotnet:/home/me/.dotnet/tools:/home/me/go/bin:/home/me/.local/share/JetBrains/Toolbox/scripts

=== Browse Page Information ===
HEAD: af874ee4223c322749888bef33433934e2e7c250
Is in merge: 0
Is in cherry_pick: 0
Is in rebase: 0
Is in revert: 0

=== Git Status Information ===

=== Our Status Information ===

=== Git Config Information ===
branch.fork-main.merge=refs/heads/main
branch.fork-main.remote=fork
branch.main.merge=refs/heads/main
branch.main.remote=origin
core.autocrlf=input
core.bare=false
core.filemode=true
core.logallrefupdates=true
core.repositoryformatversion=0
credential.https://gist.github.com.helper=!/usr/bin/gh auth git-credential
credential.https://githubhere.helper=!/usr/bin/gh auth git-credential
credential.https://githubhere.helper=!/usr/bin/gh auth git-credential
remote.fork.fetch=+refs/heads/*:refs/remotes/fork/*
remote.fork.url=git@githubhere:org/repo.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@githubhere:otherorg/repo.git
url.git@githubbhere:.insteadof=https://githubhere
[email protected]
user.name=me

=== Our Config Information ===
Git Config Path Information
Using config path: /etc/gitconfig
Using config path: /home/me/.config/git/config
Using config path: /home/me/.gitconfig
Using config path: /home/me/repos/repo/.git/config

Our config output is identical to the Git config output

=== Git Attributes Information ===
git check_attr --all output

=== Our Modified Files Newline Normalisation and EOL Information ===

=== Our Modified Files Flag Information ===
Ignoring symlinks: 0

=== Staged Files Information ===

=== Repository Statistics ===
Commit Count: 1364
Untracked Files Count: 0
Modified Files Count: 0
Staged Files Count: 0
Submodule Count: 0
Loose Objects Count: 28
Packfile Count: 2

@dpjohnst
Copy link
Member

G'day @HenrikPoulsen,

Thanks for reaching out and sorry to hear this issue has affected you.
I'll be investigating this further and will reach out again with an update.

Cheers,
- Dylan from Sublime HQ

@dpjohnst dpjohnst self-assigned this Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants