Skip to content

commit all untracked changes, including deleted files #351

Description

@nschloe

For committing all untracked changes (git commit -a) in GitPython, you have to add all dirty files to an index

index.add([diff.a_blob.path for diff in index.diff(None)])

and commit that (according to this answer on the mailing list from 2011).

Unfortunately, this doesn't work if there are deleted files. In this case, one gets

FileNotFoundError: [Errno 2] No such file or directory: 'path/to/deleted/file.txt'

Any way for dealing with this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions