Too many tags so `git tag` will stop with a colon for further input

Viewed 50

I have a repo with too many tags so when I run git tag it will stop with a colon for further input. My purpose is to write a script (shell or python) to delete all the tags less than a specific version number, say v8.x.

But as the command stops for the further input, how to I make it continue to run? Do I have to resort to expect(of pexpect) to make it work?

I found this How to use git commands without human interaction? but it didn't solve my question.

---- update ----

From VonC's answer and comment I learned Git-Config: core.pager but then I also found I can use git show-ref --tags (or better git show-ref --abbrev=7 --tags) to get what I need. I found git show-ref seems not use pager because it outputs all the tags at once.

1 Answers
Related