Reputation: 8277
This thing came out of curiosity, do git messages that we see in shell every time we run any git command do they get logged or just stdout to shell ?
Upvotes: 2
Views: 49
Reputation: 1328182
On the server side, it depends on the Git repo hosting service.
If you have control of the server you are pushing to, an intermediate authorization layer like gitolite can register any Git event (push/pull/clone, ...)
so if I get message like fatal error rejected due to non-fast-forward, and user closes its terminal and next day he doesn't remember where he was will he be able to find out what happened yesterday that he stopped working on ?
Git itself doesn't provide any logs, and only a Git wrapper of some kind could add that feature.
For instance hub or gitflow could be adapter to add logs.
In these day and age, one good wrapper coud be a docker container for executing Git command (meaning any container with Git installed, and mounting your repo as a volume)
Then, as mentioned in issue 7440 ,the command docker logs
could keep track of any output or error message. But you would have to filter through said logs in order to make sense of them.
docker run -d --name gitcontainer gitimage
docker logs gitcontainer > stdout.log 2>stderr.log
cat stdout.log
cat stderr.log
A docker container can run on Linux, or other platforms (Windows, Mac) through a virtual machine.
Upvotes: 0
Reputation: 16587
Messages you see on the command-line are not logged by default (i.e. Git is talking to you normally through printf
). Actions you do on the Git repository are logged (either recorded in history or in the reflog).
Upvotes: 1