Bobby Dore
Bobby Dore

Reputation: 893

How do I sync tags to a forked github repo?

I forked a repository on github and use the "fetch and merge" button on the web page to sync the latest code to my fork. I noticed that the code gets updated but new tags from the master repro don't end up in my fork. How do I make that happen?

Upvotes: 63

Views: 24548

Answers (2)

VonC
VonC

Reputation: 1329162

You would need, in command-line, to fetch tags

git fetch --tags upstream

Assuming upstream is the remote name referencing the original repository URL.
(If not yet defined: git remote add upstream https://github.com/original/repository).

Then push tags to your fork

git push --tags

If you want to push only the tags from the branch you are pushing:

git config --global push.followTags true

That way, a simple git push is enough.

Upvotes: 116

Lilei Zheng
Lilei Zheng

Reputation: 345

For the first one, this also works

git fetch --tags <remote-url>

Upvotes: 13

Related Questions