Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view git checkout tags history?

Tags:

git

Is there a log of all previous git pulls or tag checkouts for a git repo? We use a git checkout tags/ to update our live site, but we wanted to go back and see when all we did updates, so I'm trying to see if there is a way to check the history for git checkout tags/ command.

like image 265
Shilpam Avatar asked Oct 01 '15 23:10

Shilpam


People also ask

How do I see my entire git history?

Git file History provides information about the commit history associated with a file. To use it: Go to your project's Repository > Files. In the upper right corner, select History.

How do I see tags in git?

In order to list Git tags, you have to use the “git tag” command with no arguments. You can also execute “git tag” with the “-n” option in order to have an extensive description of your tag list. Optionally, you can choose to specify a tag pattern with the “-l” option followed by the tag pattern.

How do I list all tags?

Listing the available tags in Git is straightforward. Just type git tag (with optional -l or --list ). You can also search for tags that match a particular pattern. The command finds the most recent tag that is reachable from a commit.

Where are git tags stored?

They are stored in the . git/refs/tags directory, and just like branches the file name is the name of the tag and the file contains a SHA of a commit 3. An annotated tag is an actual object that Git creates and that carries some information. For instance it has a message, tagger, and a tag date.


2 Answers

git reflog shows the previous positions of HEAD.

like image 65
Greg Hurrell Avatar answered Oct 15 '22 08:10

Greg Hurrell


The reflog is probably the best place to see this type of information.

To show dates in the reflog output run this command:

git reflog --date=iso

Every time a tip of branch is updated (a commit, rebase, reset, etc) an entry is added to the reflog.

These entries can be used just like any other ref, meaning you can view them, revert back to them, diff them, etc.

For example, let's say you were doing a rebase and "lost" a commit. You could simply do a "git reflog" and find the identifier of the lost commit and then cherry-pick it back like this:

git reflog | grep commit # find the lost commit
git cherry-pick HEAD@{4}

Some good links:

http://git-scm.com/docs/git-reflog

http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html

Note that the entries in the reflog will stay there for around 30 days before they are garbage collected by Git. This is configurable.

like image 25
Jonathan.Brink Avatar answered Oct 15 '22 06:10

Jonathan.Brink