1

I've git config like this:

[remote "origin"]
   url = git@bitbucket.org:archie/learn-express.git
   fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
   remote = origin     <==== 
   merge = refs/heads/master
[remote "znotanto"]
   url = https://archie@bitbucket.org/znotanto/learn-express.git
   fetch = +refs/heads/*:refs/remotes/znotanto/*

I wanna change the part that I show with arrow to znotanto. I've tried git branch master --set-upstream-to znotanto/master from so but give me error

error: the requested upstream branch 'znotanto/master' does not exist

Blackjack
  • 1,016
  • 1
  • 20
  • 51

1 Answers1

1

Does the repository copy over at znotanto (https://archie@bitbucket.org/znotanto/learn-express.git) actually have a branch named master yet?

If so, use:

git fetch znotano

to get your Git to learn about it. This will have your Git create your remote-tracking name znotanto/master, after which you will be able to set znotanto/master as the upstream of any of your branches.

If not, you need to first create the name master in the Git repository at znotanto, so that your Git will see it so that your Git will create your remote-tracking name znotanto/master. So in this case, first create that branch there—exactly how is not important—and then run git fetch znotanto.

torek
  • 448,244
  • 59
  • 642
  • 775