How to change upstream branch on GitHub?

It appears that Git is unable to push the newly set upstream branch to the GitHub repo. From what I’m reading, this is because the file .git/config is only local and doesn’t get pushed.

Is there some way I can change the upstream branch via the website or either the CLI or Desktop clients? Or would pushing through Git via SSH solve the problem?

I couldn’t get SSH keys working since eval "$(ssh-agent -s)" does nothing on Windows.

What do you mean by “pushing the newly set upstream branch”? It’s not clear what you’re trying to achieve.

I’ve changed a branch’s upstream branch on my local Git repository, however when I do git push origin HEAD it doesn’t get changed on the GitHub repository. I’m basically trying to make it so when I click “Fetch upstream” on the GitHub website it’ll track a different branch than it is now, as it’s currently tracking the “master” branch in the repository I forked from.

I’m not aware of any way to sync with anything other than the default branch over the GitHub web interface, but if you sync on the command line you can merge any branch you want the same way the example in the documentation uses main. In general when working with “forks” on GitHub it’s useful to keep in mind that those are a GitHub concept, not a generic Git one. :slightly_smiling_face: