Methods like mentioned here Get list of new commits between two tags in Git? gives me list of diff files.
However, I have a constraint like I can't checkout every time to a tag because I need to serve more than 1000 request/sec asking diff files between different tags. Is there any method available to achieve this?
For example, I have 3 tags:
Now assume a file one.txt changes in all tags and head is on latest tag (1.2). Now when I do
git diff 1.0 1.1 --stat
it returns me file name one.txt so now I know that one.txt is changed, and I can grab that file. However, to get one.txt on tag 1.1, I need to checkout first at 1.1, otherwise I will get latest one.txt, so here I need to avoid that checkout and get the one.txt as it was on 1.1.
Please suggest any solution?
git checkoutUsing git checkout with a revision specifier like a branch, tag, or commit sha, along with a filepath, will checkout that revision of the file into your working copy:
git checkout <tag> -- <filepath>
Note that this only modifies the version of that one particular file. The rest of your working copy will not be affected.
From the official Linux Kernel documentation for git log (summarized):
git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>…When
<paths>or--patchare given,git checkoutdoes not switch branches. It updates the named paths in the working tree from the index file or from a named<tree-ish>(most often a commit)...The<tree-ish>argument can be used to specify a specific tree-ish (i.e. commit, tag or tree) to update the index for the given paths before updating the working tree.
git showYou can also retrieve a version of a file using git show and outputting the results to a file:
git show <tag>:<filepath> > <outputPath>
Official Linux Kernel documentation for:
git loggit showIf 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