Skip to content
\n

Stages the .git folder and all its history.

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

repo.index can't be used for cases like this as it's not a complete implementation of 'pathspecs'. It's a much narrower implementation that can be considered 'expert mode'.

\n

By default, I recommend using repo.git.add('.') instead to have the work done by git instead.

","upvoteCount":1,"url":"https://github.com/gitpython-developers/GitPython/discussions/1446#discussioncomment-2794443"}}}

add(['.']) adds the .git folder #1446

Answered by Byron
agirault asked this question in Q&A
Discussion options

You must be logged in to vote

repo.index can't be used for cases like this as it's not a complete implementation of 'pathspecs'. It's a much narrower implementation that can be considered 'expert mode'.

By default, I recommend using repo.git.add('.') instead to have the work done by git instead.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1444 on May 21, 2022 01:55.