git-clean with GitPython
Asked Answered
P

1

9

Is there any way to do something like git clean -d -x -f using GitPython?

I need to reset working directories and want to get rid of all unversioned files without deleting the whole folder (except for .git) and checking out again.

Pylorectomy answered 17/2, 2015 at 19:50 Comment(0)
C
15

You can work around by using the git command directly, from gitpython

git = repo.git
git.clean('-xdf')
Catchy answered 17/2, 2015 at 19:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.