Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7815863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:39:37+00:00 2026-06-02T05:39:37+00:00

My question is about the gpg-agent command which performs caching for gpg keys and

  • 0

My question is about the gpg-agent command which performs caching for gpg keys and pass-phrases.

I want to know how to use it so that I can run multiple git tag -s commands in a script without having to enter my gpg pass-phrase each time.

The initial version of my script is something like this:

git branch -r | grep origin | grep pattern |while read BRANCH; do TAG=basename $BRANCH; git tag -s -m “tag $TAG release” “$TAG” “$BRANCH”; done;

I have two use-cases:

  1. I have about 20 of release branches that I want to convert into tags.
  2. I have about 40 release tags that I want to redo to follow a new naming convention.

I am looking for the command line for gpg-agent to run and then the gpg command I need to run to get my pass phrase cached so that it is useable when I do a git tag -s

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:39:40+00:00Added an answer on June 2, 2026 at 5:39 am

    This can be accomplished by running gpg-agent before running the script. For example:

    $ eval $( gpg-agent --daemon )
    $ for branch in $( git branch -r | grep PATTERN ); do
    >   tag="$( basename $BRANCH )"
    >   git tag -sm "tag $tag release" "$tag" "$branch"
    > done
    

    You will be prompted for your password for the first sign (unless gpg-agent had already been used prior to the first sign). If using the above method, be sure to kill the agent after you are done (e.g. pkill gpg-agent).

    More information on running the agent can be found here: http://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question about gem installation -- when I use bundle install I know it
One question about protected constructor. I learnt that the protected constructor can be used
Quick question about Wordpress PHP: I am writing a theme and I want to
simple question about intent action naming convention: I have a new service that handles
Simple question about how to pass information in my iOS application. The appDelegate has
A question about file permissions when saving a file that when non existent, is
Simple question about best-practice. I'm using Kohana... is it okay to use helpers in
A question about data frames in R. I want to extract a row from
A question about jQuery UI dialogs. I'm creating an auto-login feature and I want
Question about the MAC-protocol of 802.11 Wifi. We have learned that when a station

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.