Skip to content

guangrei/Gitpybinding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruff status workflow test

Downloads Downloads Downloads

Fully git command binding for Python.

Features:

🔥 support any git commands, git command with "-" can be replaced with "_" like git rev-parse to git.rev_parse().

🔥 support prompt input with git.prompt = "value".

🔥 auto change path to clone destination.

🔥 custom git binary location git.gitbin = "path/to/git/binary".

🔥 support direct output to stdout or capture output to function return.

🔥 raise exception on non-zero exit code.

🔥 compatible with mypy --strict.

Example

from gitbinding import Git


git = Git(path = None, direct_output = True)
"""
path:
working directory, None = use current directory.

direct_output:
if direct_output set to False, the output is redirect to command/function return.
"""

Now you can run any git command like git.init(), git.clone("gitrepo", "destination"), git.commit(), git.push(), git.config() etc.

author: Guangrei.

Releases

No releases published

Packages

No packages published

Languages