Is there a git activity log?

Something went wrong. Let me indicate the background.

Today I try to push the default msysgit windows to our server and get an error message with an error, duplicated everywhere in SO about clicking on non-bare . I thought the message was strange since my server was supposed to be bare. And yesterday it worked fine.

Then I noticed that core.bare set to false ! It was a repo related to --bare and it never had a " .git " folder in it. And then I go to check, and here it is, the .git folder, which for me appeared out of nowhere, to my horror! I ask the only other person who could do something there, and, of course, he did not.

edit: I noticed that this only happens with the master branch, and the .git server seems to have been created on October 1, which may be correct as I don't often click on master .

The folder has 3gb and the bare folder with all git structures next to the ghostly .git has 6gb. Although my local .git has 16 gb, so I'm not sure what is going on there ... Even more, I cannot check git log or git reflog . Either a setting equal to true or false, I get the same fatal: bad default revision 'HEAD' error fatal: bad default revision 'HEAD' . And now I think it's time to consider how to restore the repo ...

But before I go through the whole dogma of restoration, I wonder:

  • Is there any git activity log, so I can see all the commands issued in git, and by whom?

Could not find anything like it, and I'm afraid not.

+4
source share
2 answers

That is why we installed gitolite V3 (just by cloning its repo and installing , as in this installation script ) on our central git repo server.

Gitolite will intercept any git commands, and (in addition to its main authorization structure, it will write the specified commands to ~/.gitolite/logs/gitolite-log-xxx ,

Here is an excerpt from such magazines:

 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/triggers/post-compile/update-git-configs,POST_COMPILE 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/triggers/post-compile/update-gitweb-access-list,POST_COMPILE 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/commands/access,%,gitweb,R,any 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/commands/git-config,-r,%,gitweb\. 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/triggers/post-compile/update-git-daemon-access-list,POST_COMPILE 2012-08-16.12:20:20 29507 system,/home/gitadmin/gitolite/bin/commands/access,%,daemon,R,any 2012-08-16.12:20:20 29507 END 2012-08-20.07:39:12 17683 ssh ARGV=gitoliteadm SOC=git-upload-pack 'gitolite-admin' FROM=127.0.0.1 2012-08-20.07:39:12 17683 access(gitolite-admin, gitoliteadm, R, 'any'),-> refs/.* 2012-08-20.07:39:12 17683 trigger,Writable,access_1,ACCESS_1,gitolite-admin,gitoliteadm,R,any,refs/.* 2012-08-20.07:39:12 17683 pre_git gitolite-admin gitoliteadm R any -> refs/.* 2012-08-20.07:39:12 17683 system,git,shell,-c,git-upload-pack '/home/gitadmin/repositories/gitolite-admin.git' 2012-08-20.07:39:12 17683 END 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/triggers/post-compile/update-git-configs,POST_COMPILE 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/triggers/post-compile/update-gitweb-access-list,POST_COMPILE 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/commands/access,%,gitweb,R,any 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/commands/git-config,-r,%,gitweb\. 2012-08-16.12:20:19 29507 system,/home/gitadmin/gitolite/bin/triggers/post-compile/update-git-daemon-access-list,POST_COMPILE 2012-08-16.12:20:20 29507 system,/home/gitadmin/gitolite/bin/commands/access,%,daemon,R,any 2012-08-16.12:20:20 29507 END 2012-08-20.07:39:12 17683 ssh ARGV=gitoliteadm SOC=git-upload-pack 'gitolite-admin' FROM=127.0.0.1 2012-08-20.07:39:12 17683 access(gitolite-admin, gitoliteadm, R, 'any'),-> refs/.* 2012-08-20.07:39:12 17683 trigger,Writable,access_1,ACCESS_1,gitolite-admin,gitoliteadm,R,any,refs/.* 2012-08-20.07:39:12 17683 pre_git gitolite-admin gitoliteadm R any -> refs/.* 2012-08-20.07:39:12 17683 system,git,shell,-c,git-upload-pack '/home/gitadmin/repositories/gitolite-admin.git' 2012-08-20.07:39:12 17683 END 
+3
source

you can use reflog to see how links move, which logs activity that is sometimes not visible from a regular git log (e.g. with a quick jump), but I don't think this should matter in your case.

I believe that you have such a structure (by default it is recommended to add the .git extension to the bare repo name, so it is easy to distinguish it): .. /core.bare.git/, containing branches, config, HEAD, hooks, info, objects etc. .. /core.bare.git/.git, containing its own set of branches, configuration, etc. I think that your repo on the server is completely fine, you just need to delete the .git folder from it and double check that the configuration file still says that this is a bare repo.

+1
source

Source: https://habr.com/ru/post/1438899/


All Articles