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

Use --no-prune-tags in git fetch command #682

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jkseppan
Copy link

@jkseppan jkseppan commented Aug 7, 2024

Documentation for --prune-tags says:

Before fetching, remove any local tags that no longer exist on
the remote if --prune is enabled.  This option should be used
more carefully, unlike --prune it will remove any local references
(local tags) that have been created. This option is a shorthand
for providing the explicit tag refspec along with --prune, see
the discussion about that in its documentation.

I had fetch.prunetags set in my .gitconfig because normally I want to delete outdated tags. But I hadn't realized that this causes my newly-created local tags to be deleted. It seems harmless to use --no-prune-tags in the git fetch command.

The option was added in Git 2.17.0. Ubuntu 18.04 has 2.17.1, Debian buster has 2.20.1, RHEL 8 has 2.18.something.

Documentation for --prune-tags says:

    Before fetching, remove any local tags that no longer exist on
    the remote if --prune is enabled.  This option should be used
    more carefully, unlike --prune it will remove any local references
    (local tags) that have been created. This option is a shorthand
    for providing the explicit tag refspec along with --prune, see
    the discussion about that in its documentation.

I had fetch.prunetags set in my .gitconfig because normally I want
to delete outdated tags. But I hadn't realized that this causes my
newly-created local tags to be deleted. It seems harmless to use
--no-prune-tags in the git fetch command.

The option was added in Git 2.17.0. Ubuntu 18.04 has 2.17.1,
Debian buster has 2.20.1, RHEL 8 has 2.18.something.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant