Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

由于commits原分支不存在,导致部分tag丢失 #118

Open
Yikun opened this issue Aug 27, 2021 · 0 comments
Open

由于commits原分支不存在,导致部分tag丢失 #118

Yikun opened this issue Aug 27, 2021 · 0 comments
Labels
feature New feature or request

Comments

@Yikun
Copy link
Owner

Yikun commented Aug 27, 2021

git push -f github refs/remotes/origin/:refs/heads/ --tags --prune,这么推送可能会漏标签, 应该是推refs/heads//*一次, 推refs/tags/*一次

--prune 这个参数会删除远端 本地不存在的分支

典型情况:

  1. master 做A事情,dev做B事情
  2. 两条分支分别打标签master_tag dev_tag
  3. dev废弃了,删除分支 (此时存在的分支,均与dev_tag无关)
    用你上面的命令会把dev_tag漏掉

Try:

git push -f github refs/remotes/origin/*:refs/heads/* --prune
git push -f github refs/remotes/origin/*:refs/tags/* --prune
@Yikun Yikun added the feature New feature or request label Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant