I have been trying to create a private r package which would be managed using our company gitlab. I was following the tutorial from the R Packages book on creating a package from scratch, however I get stuck at 2.5 use_git()
.
- Use git successfully initialises the git repo, however
- There are no comments in the commit history
- I cannot set (or see) the checkbox to enable version control
- I cannot set the origin of the git repo to our gitlab
Screenshot of: Tools -> Project Options
I have successfully created projects in the gitlab and cloned them, and opened them in RStudio. Using a project initialised from gitlab I can push/pull etc. but this is my first attempt at creating a package.
I guess it must be simple but I am not seeing what I am doing wrong. All help will be greatly appreciated.
I am running
- Win 10 64bit
- RStudio 1.3.1093
Running version()
returns the following:
> version
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 0.3
year 2020
month 10
day 10
svn rev 79318
language R
version.string R version 4.0.3 (2020-10-10)
nickname Bunny-Wunnies Freak Out
SOLUTION: Thanks to NelsonGon for putting me onto the right path.
- Run
usethis::use_git_remote(name = "firstr", url = "https://mycompanygit/username/firstr.git")
from the console - Run
git push -u firstr master
from the terminal (to push the git project from the local repo to the gitlab and set the gitlab as the upstream ref), this was a helpful site - Close and restart R or the "Push/Pull" buttons will be greyed out
I do have a follow on question, how can step two be done from the R console, is there are command in the usethis::
package that does that?