diff --git a/cbutil/util.py b/cbutil/util.py
index 4a21e99851d12c060b62e6010de035d06b2d5aae..599377556fae664ecf54f56e802ab1df55ad51eb 100644
--- a/cbutil/util.py
+++ b/cbutil/util.py
@@ -1,6 +1,46 @@
+import git
+
+from typing import Union, Tuple
+from pathlib import Path
+
+
+def remove_newline(string: str) -> str:
+    return string.replace("\n", " ").strip()
+
 
 def read_file_line_wise(path):
     """Linewise generator of a file """
     with open(path, "r") as file_to_read:
         for line in file_to_read.readlines():
             yield line.strip("\n")
+
+
+def get_repo(repo_path: Union[Path, str]) -> git.Repo:
+    return git.Repo(repo_path)
+
+
+def get_current_head(repo: git.Repo) -> git.Commit:
+    return repo.head.commit
+
+
+def get_commit_infos(commit) -> Tuple[str, str]:
+    return commit.hexsha, commit.message
+
+
+def get_head_info(repo_path: Path):
+    return get_commit_infos(get_current_head(get_repo(repo_path)))
+
+
+def get_submodule(submodule_name: str, repo: git.Repo) -> git.Submodule:
+    return repo.submodule(submodule_name)
+
+
+def get_submodule_path(submodule_name: str, repo_path: Union[Path, str] = ".") -> Path:
+    submodule_path = get_submodule(submodule_name, get_repo(repo_path)).path
+    return Path(repo_path, submodule_path)
+
+
+def get_git_infos(repo_path: Union[Path, str], *, commit_key="commit", commit_msg_key="commit_message"):
+    commit, commit_msg = get_commit_infos(get_current_head(get_repo(repo_path)))
+    commit_msg = remove_newline(commit_msg)
+    return {commit_key: commit, commit_msg_key: commit_msg}
diff --git a/setup.py b/setup.py
index b6d856d593df734723fa535ffc1ba9235ac99c52..6c26fd6e4eefe8f3a173dcdf3fbdcf367d930c94 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,8 @@ setup(name="cb-util",
       packages=find_packages(include=["cbutil"]),
       install_requires=[
           "python-dotenv",
-          "influxdb"
+          "influxdb",
+          "gitpython",
       ],
       setup_requires=['pytest-runner'],
       tests_require=['pytest']