문제

In git command line, we can use git commit -a.

How can I do that using dulwich?

도움이 되었습니까?

해결책

When considering the various tests for a commit, like those in test_repository.py, it doesn't seem to be possible in one line:

    r.stage(['a'])
    commit_sha = r.do_commit('modified a',
                             committer='Test Committer <test@nodomain.com>',
                             author='Test Author <test@nodomain.com>',
                             commit_timestamp=12395, commit_timezone=0,
                             author_timestamp=12395, author_timezone=0)

You need to find modified or deleted files first, and stage them, before calling the commit.

The other alternative would be to use git-python, which is a wrapper to git, but it doesn't offer either that feature out of the box.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top