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 7092637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:20:20+00:00 2026-05-28T08:20:20+00:00

For example, I’d like to do the following… $ git tag -a v1.0 [-d

  • 0

For example, I’d like to do the following…

$ git tag -a v1.0 [-d 2012-01-01] -m 'the demo version from January 1, 2011'

… and have the tag reflect the repository for all commits on that date.

  • 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-05-28T08:20:21+00:00Added an answer on May 28, 2026 at 8:20 am

    Note that you’re actually asking for something tricky. Suppose that B represents a commit made before the date in question, and A represents one made after it, and your history looks like this:

    - B - B - B - A - A - A - A
       \             /
        B - B - A - A
    

    Where do you want your tag? Probably at that merge commit. It’s already tricky to define. Now imagine the merges are more complex, that some of the commits made before the given date weren’t pushed to the central repo until after, and so on. You can come up with a definition, but it’s not anything simple, and not a concept that’s built into Git in any way.

    Of course, if your history is linear, and you’re not worried about when things were published, there’d be an easy-to-find commit, which you could get with:

    git rev-list --before='2012-01-01' -n 1 <branch>
    

    (There’s also --after, to find all commits after the given date.)

    This is a bit beside the point anyway; what you should really aim for with tags is marking version, milestones, stable points, versions that were released or distributed, and so on. Of course it’s best to tag them as they occur, but you may still be able to figure it out about past versions. These are the kinds of tags that will tend to actually be useful.

    If you still want to try to make retroactive date-based tags, and your history isn’t simple, Adam’s suggestion is the closest you’re likely to get, but do note the caveats I described in the comments there. Note that for it to really be meaningful, you’d want to know what the central repository had on that date, not your local one. Reflogs aren’t by default enabled in bare repositories, but if you happen to have turned them on there, you could get the commit in question by going to that bare repository and running git rev-parse master@{2012-01-01}. Otherwise, the next best thing in your local repository would be git tag v1.0 origin/master@{2012-01-01} – giving you the position of your tracking branch on that date.

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

Sidebar

Related Questions

Example from Mac OS X: [[aView animator] setFrame:NSMakeRect(100.0,100.0,300.0,300.0)]; I have tried something similar in
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Example: You have a shortcut s to SomeProgram in the current directory. In cmd.exe
Example I have Person , SpecialPerson , and User . Person and SpecialPerson are
Example: select ename from emp where hiredate = todate('01/05/81','dd/mm/yy') and select ename from emp
Example, I have billions of short phrases, and I want to clusters of them
Example I have: @test = Pakke.find([[4], [5]]) In my Pakke table I have a
Example I have this array: @packages = [2, [4, 2, 1], 4, [4,2], [5,
Example: select * from component inner join component_supplier on component.id = component_supplier.component_id inner join
Example code: # -*- coding: utf-8 -*- from functools import wraps class MyClass(object): def

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.