r-lib / gert

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

Document `git_reset_*()` outside `git_rebase()` #224

Closed olivroy closed 3 months ago

olivroy commented 3 months ago

Fix #221?

The goal is to add basic documentation for the git_reset functions.

The goal is to see what these functions do via autocomplete

image

I kept this short and sweet as I am not sure maintainers are interested, but if you are, I would add a few concrete exampels

# Reset current branch to 8 commits before now
# better to use this when no uncommited files are currently there to avoid losing things unexpectedly.
git_reset_hard("HEAD~8")
# Cancel 4 previous commits, but keep changes unstaged
git_reset_soft("HEAD~4")
# Use a Git GUI to redo commits in a meaningful way

# Cancel untracked changes
git_reset_hard()