Skip to content

Commit 8dfe4b6

Browse files
committed
udpate instructions
- and rename default branch
1 parent 6e711b3 commit 8dfe4b6

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

docs/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,10 +2130,21 @@ <h4 id="create-the-github-repo-from-local">Create the GitHub repo from local</h4
21302130
<span class='fu'><a href='https://usethis.r-lib.org/reference/use_git_ignore.html'>use_git_ignore</a></span><span class='op'>(</span><span class='op'>)</span>
21312131
<span class='fu'>use_readme.Rmd</span><span class='op'>(</span><span class='op'>)</span>
21322132
<span class='fu'><a href='https://usethis.r-lib.org/reference/licenses.html'>use_ccby_license</a></span><span class='op'>(</span><span class='op'>)</span>
2133+
<span class='co'># Before next step → stage &amp; commit changes</span>
21332134
<span class='fu'><a href='https://usethis.r-lib.org/reference/use_github.html'>use_github</a></span><span class='op'>(</span><span class='op'>)</span> <span class='co'># Connect local repo to GitHub</span>
21342135
</code></pre>
21352136
</div>
21362137
</div>
2138+
<h4 id="rename-default-branch">Rename default branch</h4>
2139+
<div class="layout-chunk" data-layout="l-body">
2140+
<div class="sourceCode">
2141+
<pre class="sourceCode r"><code class="sourceCode r"><span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://usethis.r-lib.org'>usethis</a></span><span class='op'>)</span>
2142+
<span class='fu'><a href='https://usethis.r-lib.org/reference/git-default-branch.html'>git_default_branch</a></span><span class='op'>(</span><span class='op'>)</span>
2143+
<span class='fu'><a href='https://usethis.r-lib.org/reference/git-default-branch.html'>git_default_branch_rename</a></span><span class='op'>(</span><span class='op'>)</span>
2144+
<span class='fu'><a href='https://usethis.r-lib.org/reference/git-default-branch.html'>git_default_branch_rediscover</a></span><span class='op'>(</span><span class='op'>)</span>
2145+
</code></pre>
2146+
</div>
2147+
</div>
21372148
<h4 id="set-up-git-and-manage-github-credentials">set-up git and manage GitHub credentials</h4>
21382149
<div class="layout-chunk" data-layout="l-body">
21392150
<div class="sourceCode">

docs/search.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"title": "Git, GitHub & RStudio",
66
"description": "RStudio users can leverage git Version control to enhance reproducibility.",
77
"author": [],
8-
"contents": "\r\nThe usethis package and the RStudio IDE will help you orchestrate your version control repositories as RStudio projects.\r\n\r\n\r\n\r\n\r\n\r\nSetup\r\nTo get started, make a free GitHub.com account. Make sure you have the latest versions of R, RStudio, and usethis. Then, setup your RStudio configuration using two key documents: Setup, and Managing Git(Hub) Credentials.\r\nTips\r\nClone or fork from GitHub\r\n\r\n\r\nusethis::create_from_github(\"https://github.com/data-and-visualization/git-tutorial\")\r\n\r\n\r\n\r\nCreate the GitHub repo from local\r\n\r\n\r\nlibrary(usethis)\r\nuse_git() # initialize a git repo\r\nuse_git_ignore()\r\nuse_readme.Rmd()\r\nuse_ccby_license()\r\nuse_github() # Connect local repo to GitHub\r\n\r\n\r\n\r\nset-up git and manage GitHub credentials\r\n\r\n\r\n# Sign-in to your GitHub account\r\n# Read: https://usethis.r-lib.org/articles/articles/git-credentials.html\r\n# Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html\r\nusethis::create_github_token()\r\ngitcreds::gitcreds_set()\r\ngh::gh_whoami()\r\nusethis::git_sitrep()\r\nusethis::use_git_config(user.name = \"Jane Doe\", user.email = \"[email protected]\")\r\nusethis::git_sitrep()\r\n\r\n\r\n\r\nNext Level…\r\nTake your reproducibility to the next level. Make your code citable by connecting your GitHub repo and your ORCID (unique author ID) through to the Zenodo archival repository. Now, every time you commit a milestone release, you also mint a DOI.\r\nContainerize your repository with binder.org using the holepunch package.\r\nQuick_Publish your code in a binder.org container\r\nUse the holepunch package\r\n\r\n\r\nlibrary(holepunch)\r\n\r\nwrite_compendium_description()\r\nwrite_dockerfile()\r\ngenerate_badge()\r\nbuild_binder()\r\n\r\n\r\n\r\nBespoke_Publish your code in a binder\r\nI recently found my QuickPublish approach didn’t quite work. So I RTFMed the binder.org docs and it seemed to imply a preference for NOT using a .binder/Dockerfile. Therefore, here is an approach that is slightly less automated but more bulletproof.\r\nStep 1\r\n\r\n\r\nholepunch::write_compendium_description() # output is a DESCRIPTION file in the project root\r\nholepunch::write_runtime() # output is .binder/runtime.txt\r\nholepunch::write_install() # output is .binder/install.R\r\nholepunch::generate_badge() # output is a badge to be found in the README file(s)\r\n\r\n\r\n\r\nStep 2\r\nEdit the .binder/install.R file using the following model.\r\nEdit the binder/install.R file based on this model or the documentation\r\nEdit the DESCRIPTION file using this basic model. Modify all the fields. You may want to base the Depends and Remotes sections on your .binder/install.R file\r\nThe old documentation from this site can be found in the v.0.2019 release on GitHub.\r\n\r\n\r\n\r\n",
9-
"last_modified": "2021-11-19T14:27:38-05:00"
8+
"contents": "\r\nThe usethis package and the RStudio IDE will help you orchestrate your version control repositories as RStudio projects.\r\n\r\n\r\n\r\n\r\n\r\nSetup\r\nTo get started, make a free GitHub.com account. Make sure you have the latest versions of R, RStudio, and usethis. Then, setup your RStudio configuration using two key documents: Setup, and Managing Git(Hub) Credentials.\r\nTips\r\nClone or fork from GitHub\r\n\r\n\r\nusethis::create_from_github(\"https://github.com/data-and-visualization/git-tutorial\")\r\n\r\n\r\n\r\nCreate the GitHub repo from local\r\n\r\n\r\nlibrary(usethis)\r\nuse_git() # initialize a git repo\r\nuse_git_ignore()\r\nuse_readme.Rmd()\r\nuse_ccby_license()\r\n# Before next step → stage & commit changes\r\nuse_github() # Connect local repo to GitHub\r\n\r\n\r\n\r\nRename default branch\r\n\r\n\r\nlibrary(usethis)\r\ngit_default_branch()\r\ngit_default_branch_rename()\r\ngit_default_branch_rediscover()\r\n\r\n\r\n\r\nset-up git and manage GitHub credentials\r\n\r\n\r\n# Sign-in to your GitHub account\r\n# Read: https://usethis.r-lib.org/articles/articles/git-credentials.html\r\n# Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html\r\nusethis::create_github_token()\r\ngitcreds::gitcreds_set()\r\ngh::gh_whoami()\r\nusethis::git_sitrep()\r\nusethis::use_git_config(user.name = \"Jane Doe\", user.email = \"[email protected]\")\r\nusethis::git_sitrep()\r\n\r\n\r\n\r\nNext Level…\r\nTake your reproducibility to the next level. Make your code citable by connecting your GitHub repo and your ORCID (unique author ID) through to the Zenodo archival repository. Now, every time you commit a milestone release, you also mint a DOI.\r\nContainerize your repository with binder.org using the holepunch package.\r\nQuick_Publish your code in a binder.org container\r\nUse the holepunch package\r\n\r\n\r\nlibrary(holepunch)\r\n\r\nwrite_compendium_description()\r\nwrite_dockerfile()\r\ngenerate_badge()\r\nbuild_binder()\r\n\r\n\r\n\r\nBespoke_Publish your code in a binder\r\nI recently found my QuickPublish approach didn’t quite work. So I RTFMed the binder.org docs and it seemed to imply a preference for NOT using a .binder/Dockerfile. Therefore, here is an approach that is slightly less automated but more bulletproof.\r\nStep 1\r\n\r\n\r\nholepunch::write_compendium_description() # output is a DESCRIPTION file in the project root\r\nholepunch::write_runtime() # output is .binder/runtime.txt\r\nholepunch::write_install() # output is .binder/install.R\r\nholepunch::generate_badge() # output is a badge to be found in the README file(s)\r\n\r\n\r\n\r\nStep 2\r\nEdit the .binder/install.R file using the following model.\r\nEdit the binder/install.R file based on this model or the documentation\r\nEdit the DESCRIPTION file using this basic model. Modify all the fields. You may want to base the Depends and Remotes sections on your .binder/install.R file\r\nThe old documentation from this site can be found in the v.0.2019 release on GitHub.\r\n\r\n\r\n\r\n",
9+
"last_modified": "2022-04-05T11:39:25-04:00"
1010
},
1111
{
1212
"path": "resources.html",
1313
"title": "Resources",
1414
"author": [],
1515
"contents": "\r\nSlides\r\nResearch Reproducibility, 2021\r\nSocial Coding Sites\r\nhttps://github.com\r\nhttps://gitlab.com\r\nhttps://bitbucket.org\r\nDuke’s GitLab Instance\r\nManaging SSH keys\r\n\r\nGUI Git Clients\r\nRStudio – Free. Great for useRs\r\nSublime’s Merge – Downloaded and evaluated for free. $100 / 3-years of upgrades.\r\nGitKracken – Free if you have the GitHub Student Pack or the GitHub Teacher toolbox\r\nSourceTree – Free. (defaults to use with BitBucket)\r\nPackages\r\nhttps://usethis.r-lib.org/\r\nholepunch to make your reproducible code a container on binder.org\r\nFree Book\r\nHappy Git and GitHub for the useR\r\nHandy Article\r\n10 Common Problems / Solutions\r\nReproducibility\r\nWriting clear code: Tools for Reproducible Research\r\nInitial Steps Toward Reproducible Research\r\nMaking your research reproducible with TIER + R + GitHub Slides. Cetinkaya-Rundel, M. (2016). Open Science Framework. Retrieved from https://osf.io/phyau\r\n\r\n\r\n\r\n",
16-
"last_modified": "2021-11-19T14:27:39-05:00"
16+
"last_modified": "2022-04-05T11:39:25-04:00"
1717
}
1818
],
1919
"collections": []

docs/sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" version="1.0">
33
<url>
44
<loc>https://rfun.library.duke.edu/</loc>
5-
<lastmod>2021-11-19T14:27:28-05:00</lastmod>
5+
<lastmod>2022-04-05T11:39:20-04:00</lastmod>
66
</url>
77
<url>
88
<loc>https://rfun.library.duke.edu/resources.html</loc>

index.Rmd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,19 @@ use_git() # initialize a git repo
4242
use_git_ignore()
4343
use_readme.Rmd()
4444
use_ccby_license()
45+
# Before next step → stage & commit changes
4546
use_github() # Connect local repo to GitHub
4647
```
4748

49+
#### Rename default branch
50+
51+
```{r echo=TRUE, eval=FALSE}
52+
library(usethis)
53+
git_default_branch()
54+
git_default_branch_rename()
55+
git_default_branch_rediscover()
56+
```
57+
4858
#### set-up git and manage GitHub credentials
4959

5060
```{r echo=TRUE, eval=FALSE}

0 commit comments

Comments
 (0)