GitPython
GitPython copied to clipboard
GitPython is a python library used to interact with Git repositories.
The behavior of the `repo.index.add()` method behaves differently than the CLI equivalent `git add`: ``` 0$ git add * 0$ python3 -c 'import git; git.Repo.init().git.add("*")' 0$ python3 -c 'import git;...
The `git.Repo()` constructor in GitPython fails to correctly initialize a repository when called without a path from within a Git *worktree* and the `GIT_DIR` environment variable is set to that...
This extends the `Tree.join` and `Tree.__truediv__` API to allow a pathlike object. For example: ```python repo = Repo(my_local_repo) interesting_filepath: Path = Path(folder) / file blob = repo.tree() / interesting_filepath ```...
## Summary Fixes #2013 When `diff.mnemonicPrefix=true` is set in git config, git uses different prefixes for diff paths instead of the standard `a/` and `b/`: - `c/` for commit -...
## Summary Fixes #2064 The `packed-refs` file can contain ref names that are not valid UTF-8 (e.g., Latin-1 encoded tag names created by older Git versions or systems with different...
## Summary Fixes #2083 The `run_commit_hook()` function was hardcoded to look for hooks in `$GIT_DIR/hooks`, ignoring the `core.hooksPath` configuration option that Git has supported since v2.9. ## Changes - Add...
[Commit hooks are more-or-less hardcoded](https://github.com/gitpython-developers/GitPython/blob/main/git/index/fun.py#L85) to use hooks found in `.git/hooks`. This means that specifying `core.hooksPath` in any git config file (i.e. `/etc/gitconfig`, `~/.gitconfig`, `~/git/config`, `$REPO/.git/config`) has no effect. Is...
Consumers of gitpython may not need to use it in all use cases, and may want to be able to run (without using gitpython) in environments where git is not...
Hey **GitPython** maintainers, I am reaching out on behalf of **[Splunk SOAR](https://www.splunk.com/en_us/products/splunk-security-orchestration-and-automation.html)**, as part of our internal migration effort to **Python 3.13**. ### What we’re requesting - Confirm whether this...
I get a this error in our repo specifically with one commit which has `2064 files changed, 3030969 insertions(+)`. ``` Python 3.10.12 (main, May 27 2025, 17:12:29) [GCC 11.4.0] on...