In your tag naming, please don't incorporate the name of the remote --
which as seen on your machine is apparently "origin".  FIWW on my
checkouts, I avoid that ambiguous word; I chose "apache".  I don't see what
value it has in the tag name.  Thus the tag name you propose would become:
"history/branches/lucene-solr/jira/SOLR-13452_gradle_2".  Still, the prefix
is quite long; I'm unsure why it has "lucene-solr" in there; maybe because
there are/were repo roots for Lucene and Solr's history separately?

You can do a lot in git without doing a "checkout" of what it is you want
to operate on.  In your case, don't waste your time doing a checkout of the
target branch (undoubtedly will be very jarring to your IDE); you can chill
out on master the whole time.
Here is how to tag a branch based on your example... BTW I found this
simply by doing "git tag --help":
  git tag history/branches/lucene-solr/jira/SOLR-13452_gradle_2
apache/jira/SOLR-13452_gradle_2
First arg is the tag name, second arg is a reference to the commit you are
tagging.
So without doing that needless checkout, this also means you needn't create
a local branch of it only to then need to delete it later.  Simpler.

~ David Smiley
Apache Lucene/Solr Search Developer
http://www.linkedin.com/in/davidwsmiley


On Sun, Oct 25, 2020 at 11:43 AM Erick Erickson <[email protected]>
wrote:

> I played around a bit in my repo and this sequence seems to do what I want
> now that Dawid suggested tagging before removing: tag a branch then remove
> it from the drop-down.
>
> We have a branch jira/SOLR-13452_gradle_2 for example:
>
> // First track the branch
> git checkout  --track origin/jira/SOLR-13452_gradle_2
>
> // note, we already have a number of tags that start with
> history/branches/lucene-solr so that seems like the right prefix.
> // tag the branch locally
> git tag history/branches/lucene-solr/origin/jira/SOLR-13452_gradle_2
>
> // push the tag
> git push origin
> history/branches/lucene-solr/origin/jira/SOLR-13452_gradle_2
>
> // delete the remote branch:
> git push origin --delete origin/jira/SOLR-13452_gradle_2
>
> // switch to another branch do I can delete the local branch, then delete
> the local branch
> - git branch -d origin/jira/SOLR-13452_gradle_2
>
> Does this work? Or is there a more efficient way? ‘cause I intend to do 10
> or so at a time for JIRAs that are closed etc.
>
> Thanks,
> Erick
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to