Ali Ali - 1 month ago 9
Git Question

git create local branch for a forked upstream tag

I've been trying to find a way to create a local branch that starts from a tag on an upstream repo I've forked and haven't found anything that helps.

I have the upstream master on a master branch locally but I'm not sure what I need to do to branch the upstream tag.

I've tried:

git branch upstream/master tagname
git branch master tagname
git branch upstream tagname


and none of those worked. Thanks.

Answer Source

If the tag is fetched (your master reflects upstream/master)

git checkout -b myupstream atagname

You need to make sure you have fetched the tags first.
That means git fetch myupstream and then git fetch myupstream --tags