gitloggingbare

Git update log of a bare repository


I need to regularly extract the git logs for all branches of several repositories. While I could clone them and then perform a git fetch, I thought about saving some disk space and time and only cloning them as bare:

git clone --bare repoUrl

After the clone, all logs and branches are up to date. I can issue git log --all and I can see all the changes up to the clone moment.

However, I am not able to fetch changes from the remote repo when it gets updated. I.e. if I issue: git fetch --all and then git log --all, I don't see any of the change that happened in the remote repo.

How can I update the state of my local repository when the remote receives new commits?

I have tried:


Solution

  • I found the solution reading this answer related to a similar question (I only need to extract the logs, not to pull the code).

    After cloning, I've to add:

    git config remote.origin.fetch "+*:*"

    so that git can keep track of all the branches, even remote ones. Then, issuing git fetch --all --prune and git log --all I can see all the changes.