git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Git log of all (modifying) commands run on a repo?

From
Bill Lear <rael@zopyra.com>
Date
Feb 7, 2007, 22:15 UTC
Message-ID
<17866.20355.744025.133326@lisa.zopyra.com>

Our company recently switched to git. Our enthusiasm for git outweighs the problems we have encountered so far, universally those of user befuddlement, not git problems per se.

I have destroyed several repos by accidentally pulling from or pushing to the wrong branch, not realizing this until later, and, trying what I thought the proper way to undo it, failed that miserably. I have destroyed a few other repos by pulling from a "polluted" repo of a co-worker that had mistakenly merged things in, and have had to resort each time to full-scale reconstructions (again, almost trivially accomplished thanks to git). Thankfully, our company repo is so far pristine, and I have been able to quickly reconstruct things and continue working.

A co-worker just called to say he apparently had done something similar, as he tried to pull from our company repo, got a conflict, and then discovered files and changes to files that should not have been on the master branch. These files and changes do not exist in our company repo, of that we are certain.

I'm not certain how I managed to screw up my repo, and he is equally unsure of how he managed to screw up his.

I thought that it would be very useful to have a history of git commands that have been run against a repo, in order to hopefully debug this sort of thing --- perhaps only those that modify the repo.

I suppose this would need to include information about which branches were affected as well.

% cat .git/repo.log [....] 2007-02-07 10:05:44 git pull . ..... ** Pull from master branch onto project branch ** Pull from foobar branch onto boobar branch ** ... 2007-02-07 10:05:44 git pull git://source/project master:project ** Your explanation here...

Would this sort of thing be easy to do? I presume git does not currently have support for this, but thought I would ask.

Bill
Next: Jakub Narebski
Message 1 of 25 in “Git log of all (modifying) commands run on a repo?”
  1. Bill LearFeb 7, 2007
  2. Jakub NarebskiFeb 7, 2007
  3. Bill LearFeb 7, 2007
  4. Jakub NarebskiFeb 7, 2007
  5. Linus TorvaldsFeb 7, 2007
  6. Junio C HamanoFeb 7, 2007
  7. Shawn O. PearceFeb 7, 2007
  8. Linus TorvaldsFeb 7, 2007
  9. Junio C HamanoFeb 7, 2007
  10. Linus TorvaldsFeb 7, 2007
  11. Jakub NarebskiFeb 7, 2007
  12. Johannes SchindelinFeb 7, 2007
  13. Shawn O. PearceFeb 8, 2007
  14. Junio C HamanoFeb 8, 2007
  15. Johannes SchindelinFeb 8, 2007
  16. Junio C HamanoFeb 8, 2007
  17. Johannes SchindelinFeb 8, 2007
  18. Linus TorvaldsFeb 8, 2007
  19. Johannes SchindelinFeb 8, 2007
  20. Shawn O. PearceFeb 7, 2007
  21. Bill LearFeb 7, 2007
  22. Linus TorvaldsFeb 7, 2007
  23. Bill LearFeb 7, 2007
  24. Linus TorvaldsFeb 7, 2007
  25. Johannes SixtFeb 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.