linkahead.utils.git_utils module#

git-utils: Some functions for retrieving information about git repositories.

linkahead.utils.git_utils.get_branch_in(folder: str)#

returns the current branch of the git repository in the given folder.

The command “git branch” is called in the given folder and the output is returned

linkahead.utils.git_utils.get_commit_in(folder: str)#

returns the commit hash in of the git repository in the given folder.

The command “git log -1 –format=%h” is called in the given folder and the output is returned

linkahead.utils.git_utils.get_diff_in(folder: str, save_dir=None)#

returns the name of a file where the out put of “git diff” in the given folder is stored.

linkahead.utils.git_utils.get_origin_url_in(folder: str)#

return the Fetch URL of the git repository in the given folder.