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.
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.
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.
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.
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.
git reflog
shows the previous positions of HEAD
.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With