{"id":24307755,"url":"https://github.com/stufield/gitr","last_synced_at":"2026-04-29T23:33:16.361Z","repository":{"id":65904741,"uuid":"431206929","full_name":"stufield/gitr","owner":"stufield","description":"A light-weight, dependency-free, API to access system-level git commands from within R","archived":false,"fork":false,"pushed_at":"2025-04-22T15:03:09.000Z","size":1837,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-09T04:19:27.197Z","etag":null,"topics":["git","r","r-package","zsh"],"latest_commit_sha":null,"homepage":"https://stufield.github.io/gitr/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stufield.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-23T18:12:48.000Z","updated_at":"2025-10-06T09:37:35.000Z","dependencies_parsed_at":"2024-05-30T01:48:44.845Z","dependency_job_id":"2087966e-0467-46a7-9136-f6d374b35b71","html_url":"https://github.com/stufield/gitr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stufield/gitr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stufield%2Fgitr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stufield%2Fgitr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stufield%2Fgitr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stufield%2Fgitr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stufield","download_url":"https://codeload.github.com/stufield/gitr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stufield%2Fgitr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","r","r-package","zsh"],"created_at":"2025-01-17T04:19:28.652Z","updated_at":"2026-04-29T23:33:16.355Z","avatar_url":"https://github.com/stufield.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\noptions(width = 100)\nSys.setlocale(\"LC_COLLATE\", \"en_US.UTF-8\") # ensure common sorting envir\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\nver \u003c- desc::desc_get_version(\".\")\nver \u003c- paste0(\"https://img.shields.io/badge/Version-\", ver,\n              \"-success.svg?style=flat\u0026logo=github\")\n```\n\n# gitr\n\n\u003c!-- badges: start --\u003e\n![GitHub version](`r ver`)\n[![CRAN status](http://www.r-pkg.org/badges/version/gitr)](https://cran.r-project.org/package=gitr)\n[![R-CMD-check](https://github.com/stufield/gitr/workflows/R-CMD-check/badge.svg)](https://github.com/stufield/gitr/actions)\n[![](https://cranlogs.r-pkg.org/badges/grand-total/gitr)](https://cran.r-project.org/package=gitr)\n[![Codecov test coverage](https://codecov.io/gh/stufield/gitr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/stufield/gitr?branch=main)\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://choosealicense.com/licenses/mit/)\n\u003c!-- badges: end --\u003e\n\n\nA light-weight, dependency-free, application programming interface\n(API) to access system-level [Git](https://git-scm.com/downloads) commands from within `R`.\nContains wrappers and defaults for common data science workflows as well as\n[Zsh](https://github.com/ohmyzsh/ohmyzsh) plugin aliases (see below).\nA generalized API syntax is also available.\nA system installation of [Git](https://git-scm.com/downloads) is required.\n\n\nIf you run into any issues/problems with `gitr` full documentation\nof the most recent\n[release](https://github.com/stufield/gitr/releases)\ncan be found at the\n[pkgdown website](https://stufield.github.io/gitr/).\nIf the issue persists I encourage you to consult the\n[issues](https://github.com/stufield/gitr/issues/)\npage and, if appropriate, submit an issue and/or feature request.\n\n\n## Disclaimer\n\nUse at own risk :smiley_cat:, however, PRs are encouraged for ideas that I've missed.\nThe functionality contained in `gitr` are _heavily_ influenced by __my__\npersonal data science workflows and may not suit all users.\nHowever, if you have an idea that would make the package better,\nmore widely usable, and/or efficient, please submit an\n[issue](https://github.com/stufield/gitr/issues/)\nor\n[pull request](https://github.com/stufield/gitr/pulls/).\n\n\n## Installing\n\nThe easiest way to install `gitr` is to install directly from\n[CRAN](https://CRAN.R-project.org/package=gitr)\n\n\n```{r install-cran, eval = FALSE}\ninstall.packages(\"gitr\")\n```\n\nAlternatively install the development version from GitHub:\n\n```{r install-gh, eval = FALSE}\nremotes::install_github(\"stufield/gitr\")\n```\n\nTo install a *specific* tagged release, use:\n\n```{r install-version, eval = FALSE}\nremotes::install_github(\"stufield/gitr@v0.0.2\")\n```\n\n\n-----------\n\n## Loading\n\n```{r load}\nlibrary(gitr)\n```\n\n\n## Examples\n\nHere are some basic examples of the functionality grouped by common\nactions:\n\n#### Basics\n```{r ver}\ngit_version()\n```\n\n```{r current}\ngitr_current_br()\n```\n\n```{r default}\ngitr_default_br()\n```\n\n```{r local}\ngitr_local_br()\n```\n\n\n#### The Core Engine\n\n```{r git-core}\n(git(\"branch foo\"))\n\ngit(\"branch -av\")$stdout |\u003e\n  cat(sep = \"\\n\")\n\ngit(\"branch -D foo\")$stdout\n```\n\n\n#### Committing\n\n```{r commit-msgs}\ngitr_commit_msgs(n = 3L)\n```\n\n```{r glog}\nglog(5L)\n```\n\n```{r commit-diff, eval = FALSE}\ngit_diffcommits()\n```\n\n```{r reset-hard, eval = FALSE}\ngit_reset_hard()\n```\n\n```{r reset-soft, eval = FALSE}\ngit_reset_soft()\n```\n\n```{r uncommit, eval = FALSE}\ngit_uncommit()\n```\n\n```{r unstage, eval = FALSE}\ngit_unstage(\"DESCRIPTION\")\n```\n\n\n#### Secure Hash Algorithm (SHA-1)\n\n```{r sha}\nis_sha(\"d670c93733f3e1d7c95df7f61ebf6ca0476f14e3\")\n\nis_sha(c(\"foo\", \"d670c93\"))   # vectorized\n\ngitr_trim_sha(\"d670c93733f3e1d7c95df7f61ebf6ca0476f14e3\")\n\ngitr_trim_sha(c(\"foo\", \"d670c93\"))   # vectorized\n\ngitr_current_sha()\n```\n\n\n#### Tags\n\n```{r tag-recent}\ngitr_recent_tag()\n```\n\n```{r tag-info}\ngitr_tag_info()\n```\n\n\n#### Situation Report\n\n```{r sitrep}\ngitr_sitrep()\n```\n\n\n\n--------\n\n\n## ZSH-aliases available in `gitr`\n\n| alias                 | git command                               |\n| :-------------------- | :---------------------------------------- |\n| `ga()`                | `git add`                                 |\n| `gst()`               | `git status`                              |\n| `gss()`               | `git status -s`                           |\n| `gau()`               | `git add -u`                              |\n| `gaa()`               | `git add --all`                           |\n| `gb()`                | `git branch`                              |\n| `gba()`               | `git branch -a`                           |\n| `gbd()`               | `git branch -d/-D`                        |\n| `gdf()`               | `git diff \u003cfile\u003e`                         |\n| `gbnm()`              | `git branch --no-merged`                  |\n| `gbmm()`              | `git branch --merged`                     |\n| `gbr()`               | `git branch --remote`                     |\n| `gac()`, `gcn`        | `git commit --no-verify --no-edit --amend`|\n| `gcc()`               | `git commit`                              |\n| `gco()`               | `git checkout`                            |\n| `gcb()`               | `git checkout -b`                         |\n| `gcm()`               | `git checkout git_default_br()`           |\n| `gcf()`               | `git config --list`                       |\n| `gnuke()`             | `git reset --hard \u0026\u0026 git clean -dfx`      |\n| `gcmsg()`             | `git commit -m`                           |\n| `gp()`                | `git push`                                |\n| `gpu()`               | `git push -u`                             |\n| `gpd()`               | `git push --dry-run`                      |\n| `gpf()`               | `git push --force-with-lease`             |\n| `gpr()`               | `git pull --rebase --autostash -v`        |\n| `glog()`              | `git log --oneline --decorate --graph`    |\n| `gwip()`              | `git add -u \u0026\u0026 commit --no-verify -m \"wip\"` |\n| `gclean()`            | `git clean -f -d`                         |\n| `grm()`               | `git rm`                                  |\n| `grmc()`              | `git rm --cached`                         |\n| `gsta()`              | `git stash`                               |\n| `gstl()`              | `git stash list`                          |\n| `gpop()`,`gstp()`     | `git stash pop`                           |\n| `gstaa()`             | `git stash apply`                         |\n| `gstd()`              | `git stash drop`                          |\n| `gstc()`              | `git stash clear`                         |\n| `gsts()`              | `git stash show --text`                   |\n| `gtn()`               | `git tag -n`                              |\n| `grba()`              | `git rebase --abort`                      |\n| `grbc()`              | `git rebase --continue`                   |\n| `grbs()`              | `git rebase --skip`                       |\n| `grbm()`              | `git rebase git_default_br()`             |\n| `grv()`               | `git remote -v`                           |\n\n\n\n-------------\n\n\n## Full list of ZSH-aliases\n\nFor general reference, here is a list of the available aliases via the\n`git-plugin` from [Oh-My-Zsh](https://github.com/ohmyzsh/ohmyzsh).\n\nSee also [Oh-My-Zsh](https://ohmyz.sh) for general installation.\n\n#### Aliases\n\n| alias            | git command                                       |\n| :--------------- | :----------------------------------------------- |\n| `gapa`           | `git add --patch`                                 |\n| `gav`            | `git add --verbose`                               |\n| `gloga`          | `git log --oneline --decorate --graph --all`      |\n| `gup`            | `git pull --rebase`                               |\n| `gupv`           | `git pull --rebase -v`                            |\n| `gupa`           | `git pull --rebase --autostash`                   |\n| `gupav`          | `git pull --rebase --autostash -v`                |\n| `gap`            | `git apply`                                       |\n| `gapt`           | `git apply --3way`                                |\n| `gbda`           | `git branch --no-color --merged \\| command grep -vE ^([+*] \\| \\s*($(git_main_branch) \\| $(git_develop_branch))\\s*$) \\| command xargs git branch -d 2\u003e/dev/null` |\n| `gbl`            | `git blame -b -w`                                 |\n| `gbs`            | `git bisect`                                      |\n| `gbsb`           | `git bisect bad`                                  |\n| `gbsg`           | `git bisect good`                                 |\n| `gbsr`           | `git bisect reset`                                |\n| `gbss`           | `git bisect start`                                |\n| `gca`            | `git commit -v -a`                                |\n| `gca!`           | `git commit -v -a --amend`                        |\n| `gcan!`          | `git commit -v -a --no-edit --amend`              |\n| `gcans!`         | `git commit -v -a -s --no-edit --amend`           |\n| `gcam`           | `git commit -a -m`                                |\n| `gcsm`           | `git commit -s -m`                                |\n| `gcas`           | `git commit -a -s`                                |\n| `gcasm`          | `git commit -a -s -m`                             |\n| `gcl`            | `git clone --recurse-submodules`                  |\n| `gcor`           | `git checkout --recurse-submodules`               |\n| `gcd`            | `git checkout $(git_develop_branch)`              |\n| `gcount`         | `git shortlog -sn`                                |\n| `gcp`            | `git cherry-pick`                                 |\n| `gcpa`           | `git cherry-pick --abort`                         |\n| `gcpc`           | `git cherry-pick --continue`                      |\n| `gcs`            | `git commit -S`                                   |\n| `gcss`           | `git commit -S -s`                                |\n| `gcssm`          | `git commit -S -s -m`                             |\n| `gdca`           | `git diff --cached`                               |\n| `gdcw`           | `git diff --cached --word-diff`                   |\n| `gdct`           | `git describe --tags $(git rev-list --tags --max-count=1)` |\n| `gds`            | `git diff --staged`                               |\n| `gdt`            | `git diff-tree --no-commit-id --name-only -r`     |\n| `gdup`           | `git diff @{upstream}`                            |\n| `gdw`            | `git diff --word-diff`                            |\n| `gf`             | `git fetch`                                       |\n| `gfo`            | `git fetch origin`                                |\n| `gfg`            | `git ls-files \\| grep`                            |\n| `gg`             | `git gui citool`                                  |\n| `gga`            | `git gui citool --amend`                          |\n| `ggpur`          | `ggu`                                             |\n| `ggpull`         | `git pull origin $(git_current_branch)`           |\n| `ggpush`         | `git push origin $(git_current_branch)`           |\n| `ggsup`          | `git branch --set-upstream-to=origin/$(git_current_branch)`|\n| `gpsup`          | `git push --set-upstream origin $(git_current_branch)`     |\n| `ghh`            | `git help`                                        |\n| `gignore`        | `git update-index --assume-unchanged`             |\n| `gignored`       | `git ls-files -v \\| grep \"^[[:lower:]]\"`          |\n| `git-svn-dcommit-push` | `git svn dcommit \u0026\u0026 git push github $(git_main_branch):svntrunk` |\n| `gl`             | `git pull`                                        |\n| `glg`            | `git log --stat`                                  |\n| `glgp`           | `git log --stat -p`                               |\n| `glgg`           | `git log --graph`                                 |\n| `glgga`          | `git log --graph --decorate --all`                |\n| `glgm`           | `git log --graph --max-count=10`                  |\n| `glo`            | `git log --oneline --decorate`                    |\n| `glol`           | `git log --graph --pretty`                        |\n| `glols=\"git log --graph --pretty` | `%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)\u003c%an\u003e%Creset' --stat\"`\n| `glod=\"git log --graph --pretty`  | `%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)\u003c%an\u003e%Creset'\"`\n| `glods=\"git log --graph --pretty` | `%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)\u003c%an\u003e%Creset' --date=short\"`\n| `glola=\"git log --graph --pretty` | `%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)\u003c%an\u003e%Creset' --all\"`\n| `gm`             | `git merge`                                       |\n| `gmom`           | `git merge origin/$(git_main_branch)`             |\n| `gmtl`           | `git mergetool --no-prompt`                       |\n| `gmtlvim`        | `git mergetool --no-prompt --tool=vimdiff`        |\n| `gmum`           | `git merge upstream/$(git_main_branch)`          |\n| `gma`            | `git merge --abort`                               |\n| `gpf!`           | `git push --force`                                |\n| `gpoat`          | `git push origin --all \u0026\u0026 git push origin --tags` |\n| `gpv`            | `git push -v`                                     |\n| `gr`             | `git remote`                                      |\n| `gra`            | `git remote add`                                  |\n| `grb`            | `git rebase`                                      |\n| `grbd`           | `git rebase $(git_develop_branch)`                |\n| `grbi`           | `git rebase -i`                                   |\n| `grbo`           | `git rebase --onto`                               |\n| `grev`           | `git revert`                                      |\n| `grh`            | `git reset`                                       |\n| `grhh`           | `git reset --hard`                                |\n| `groh`           | `git reset origin/$(git_current_branch) --hard`   |\n| `grmv`           | `git remote rename`                               |\n| `grrm`           | `git remote remove`                               |\n| `grs`            | `git restore`                                     |\n| `grset`          | `git remote set-url`                              |\n| `grss`           | `git restore --source`                            |\n| `grst`           | `git restore --staged`                            |\n| `grt`            | `cd $(git rev-parse --show-toplevel \\|\\| echo .)` |\n| `gru`            | `git reset --`                                    |\n| `grup`           | `git remote update`                               |\n| `gsb`            | `git status -sb`                                  |\n| `gsd`            | `git svn dcommit`                                 |\n| `gsh`            | `git show`                                        |\n| `gsi`            | `git submodule init`                              |\n| `gsps`           | `git show --pretty=short --show-signature`        |\n| `gsr`            | `git svn rebase`                                  |\n| `gstu`           | `gsta --include-untracked`                        |\n| `gstall`         | `git stash --all`                                 |\n| `gsu`            | `git submodule update`                            |\n| `gsw`            | `git switch`                                      |\n| `gswc`           | `git switch -c`                                   |\n| `gswm`           | `git switch $(git_main_branch)`                   |\n| `gswd`           | `git switch $(git_develop_branch)`                |\n| `gts`            | `git tag -s`                                      |\n| `gtv`            | `git tag \\| sort -V`                              |\n| `gtl`            | `gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl` |\n| `gunignore`      | `git update-index --no-assume-unchanged`          |\n| `gunwip`         | `git log -n 1 \\| grep -q -c \"\\-\\-wip\\-\\-\" \u0026\u0026 git reset HEAD~1` |\n| `glum`           | `git pull upstream $(git_main_branch)`            |\n| `gwch`           | `git whatchanged -p --abbrev-commit --pretty=medium` |\n| `gam`            | `git am`                                          |\n| `gamc`           | `git am --continue`                               |\n| `gams`           | `git am --skip`                                   |\n| `gama`           | `git am --abort`                                  |\n| `gamscp`         | `git am --show-current-patch`                     |\n\n\n#### LICENSE\n\nPlease note that this package is released with\na [LICENSE](https://github.com/stufield/gitr/blob/main/LICENSE.md).\nBy using in this package you agree to abide by its terms.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstufield%2Fgitr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstufield%2Fgitr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstufield%2Fgitr/lists"}