Here's a tool that can store a bug tracker directly in the git
repository:
https://github.com/MichaelMure/git-bug
It also comes with importers and exporters for GitHub, GitLab, Jira and
Launchpad. I don't have any personal experience with it though.