git2r icon indicating copy to clipboard operation
git2r copied to clipboard

Implement git clean

Open ilarischeinin opened this issue 6 years ago • 1 comments

I'd like to be able to remove untracked files from a repository, i.e. to run git clean -f.

It is of course trivial to use a workaround such as the one below, but are there plans to add direct support for a clean()?

# WARNING: do note this deletes untracked files
 status() %>%
  purrr::pluck("untracked") %>%
  rlang::flatten_chr() %>%
  unlink()

ilarischeinin avatar Feb 18 '19 09:02 ilarischeinin

That sounds like a nice feature. I'd be happy to accept a PR with the git_clean functionality. Is it something you have time to work on?

stewid avatar Feb 19 '19 18:02 stewid