Checking the Status (Commit Log) of Arbitrary Git Repositories

Status
Not open for further replies.

svet-am

Supreme [H]ardness
Joined
Jan 6, 2003
Messages
5,146
I have a directory that hosts a number of different Git repositories. All of these repositories are configured as bare repositories since they are shared amongst many users.

What I'd like to do is automate checking the current commit tag in each of these repositories for other use within our infrastructure.

I'm trying to do this with:

Code:
git log -n 1 --git-dir=<path_to_repo_dir>
but it is failing and returning:
Code:
fatal: Not a git repository (or any parent up to mount point /storage/archive)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
If I actually "cd" into one of the repo directories and issue the same command it works exactly as I expect. I have tried with both the --git-dir flag as well as the --work-dir flag. Is there a different way to do what I need to do that is not currently obvious to me?
 
Status
Not open for further replies.
Back
Top