r-lib / gert

Simple git client for R
https://docs.ropensci.org/gert/
Other
146 stars 31 forks source link

Feature request: create orphan branch and allow empty commits? #91

Closed zkamvar closed 3 years ago

zkamvar commented 3 years ago

I'm wondering if it's possible to incorporate this pattern into {gert} in some form (or if it's already possible and I'm just being a numpty)

git checkout --orphan gh-pages
git rm -rf --quiet .
git commit --allow-empty -m 'Initial gh-pages commit'
jennybc commented 3 years ago

Not entirely sure what your motivation is @zkamvar but depending on context you might be able to do what usethis:::create_gh_pages_branch() does:

https://github.com/r-lib/usethis/blob/cd86132a0e2c5de54cc9c5e3199c075a369bbf00/R/pkgdown.R#L150-L173

Presumably you want it for GitHub-related reasons. In which case you could create it first (or only?) on GitHub.

zkamvar commented 3 years ago

That's pretty much precisely what I want to do! Thank you :)