Skip to content
A R interface to fetch gitignore templates form gitignore.io
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
inst
man
tests
vignettes
.Rbuildignore
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
DESCRIPTION
LICENSE.md
NAMESPACE
README.Rmd
README.md
appveyor.yml
codemeta.json
gitignore.Rproj

README.md

gitignore

CRAN status License: GPL v3 AppVeyor build status Travis build status

The package gitignore provides a simple R interface to the gitignore.io API. It can be used to fetch gitignore templates that can be included into the .gitignore file of you git repository.

Installation

You can install the released version of gitignore from CRAN with:

install.packages("gitignore") # Not currently published on CRAN

Or the dev version with:

install.packages("devtools")
devtools::install_github("pmassicotte/gitignore")

Examples

There are currently two useful functions in the package:

  • gitignore_fetch_available_templates() to fetch all supported gitignore templates.
  • gitignore_fetch_ignore_templates() to fetch one or many gitignore templates.
library(gitignore)

head(gitignore_fetch_available_templates(), 25)
#>  [1] "1c"                   "1c-bitrix"            "a-frame"             
#>  [4] "actionscript"         "ada"                  "adobe"               
#>  [7] "advancedinstaller"    "agda"                 "al"                  
#> [10] "alteraquartusii"      "altium"               "android"             
#> [13] "androidstudio"        "angular"              "anjuta"              
#> [16] "ansible"              "apachecordova"        "apachehadoop"        
#> [19] "appbuilder"           "appceleratortitanium" "appcode"             
#> [22] "appcode+all"          "appcode+iml"          "appengine"           
#> [25] "aptanastudio"

Templates can be fecthed using the gitignore_fetch_ignore_templates() function.

gitignore_fetch_ignore_templates("R")

# Created by https://www.gitignore.io/api/r
# Edit at https://www.gitignore.io/?templates=r

### R ###
# History files
.Rhistory
.Rapp.history

# Session Data files
.RData

# User-specific files
.Ruserdata

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
.Rproj.user/

# produced vignettes
vignettes/*.html
vignettes/*.pdf

# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth

# knitr and R markdown default cache directories
/*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md

### R.Bookdown Stack ###
# R package: bookdown caching files
/*_files/

# End of https://www.gitignore.io/api/r

Multiple templates can be fetched by specifying multiple values:

gitignore_fetch_ignore_templates(c("java", "c++"))

# Created by https://www.gitignore.io/api/java,c++
# Edit at https://www.gitignore.io/?templates=java,c++

### C++ ###
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# End of https://www.gitignore.io/api/java,c++

Code of conduct

Please note that the ‘gitignore’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

You can’t perform that action at this time.