0

This may not be what git is intended for, but I am asking because it will be very handy for certain cases.

I have a git repository repo, and a directory dir containing files of a particular checkout of repo. The dir is created by copying files from repo out, but does not contain the git internals (.git/). This is similar to what you get if you download a tarball/zip from github or gitlab.

  1. If dir is precisely as described, without any modifications, is there a way to tell which version (of repo) is dir from?
  2. If dir also has some files changed (e.g. added a line to a file, deleted a file), is it still possible to identify which version it corresponds to? (We can safely assume this modification is not a part of any commit in repo.)

Surely, the repo is on local machine, and I can do arbitrary things to it. The working tree is clean.

renyuneyun
  • 608
  • 5
  • 18

0 Answers0