Sazzad Hissain Khan
Sazzad Hissain Khan

Reputation: 40236

warning: Not setting branch master as its own upstream

I am trying to set git branch upstream but getting below warning.

Command

git checkout master
git branch --set-upstream-to master

warning: Not setting branch master as its own upstream.

How can I solve it?

Does that mean it already being tracing correct remote branch master?

Upvotes: 7

Views: 11384

Answers (1)

VonC
VonC

Reputation: 1327434

That should be:

 git branch --set-upstream-to origin/master

But if origin/master is there, the checkout should have tracked it already.

If <branch> is not found but there does exist a tracking branch in exactly one remote (call it <remote>) with a matching name and --no-guess is not specified, treat as equivalent to:

$ git checkout -b <branch> --track <remote>/<branch>

With Git 2.23+, you would use git switch master instead of checkout, as I mentioned here.

Upvotes: 12

Related Questions