Tags need not be pointing at commits so there is no way to See the git-fetch-script code in fast_forward_local() with the comment: This changes the long-standing behavior of " fetch" added in 853a369 (" Multi-head fetch.",, Git 0.99.5).īefore this change, all tag fetches effectively had -force enabled. Should clobber a local tag of the same name. (Merged by Junio C Hamano - gitster - in commit d39cab3, ) fetch: stop clobbering existing tags without -forceĬhange " fetch" to treat " +" in refspecs (aka -force) to mean we See commit 0bc8d71, commit ae6a470, commit fe802bd, commit 8da6128, commit d931455, commit 6b0b067, commit 253b3d4, commit f08fb8d, commit 8cd4b7c () by Ævar Arnfjörð Bjarmason ( avar). " git fetch" was taught to forbid updates to existing tags without the " -force" option. The rules used by " git push" and " git fetch" to determine if a ref can or cannot be updated were inconsistent specifically, fetching to update existing tags were allowed even though tags are supposed to be unmoving anchoring points. In addition of scripting (with pure git commands) the number of bad tags, Git 2.20 (Q4 2018) offers an alternative to avoid having to get tags with the same name with a branch. Git branch -r -list 'origin/*' -format="%(refname:lstrip=3)" That gives you pure git commands: git tag -sort="refname" > tags The pattern ' origin/*' makes sure we are selecting the remote branches of the right remote repo. The format transforms a remotes/origin/aBranchName into aBranchName. No need to grep origin, sed or sort (unless a branch.sort config had been set): use a pattern and a format: git branch -r -list 'origin/*' -format="%(refname:lstrip=3)"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |