Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I actually use wflow_git_pull()? Can I clone github repos using wflow_git_pull()? #281

Open
ogorodriguez opened this issue Jan 28, 2023 · 2 comments

Comments

@ogorodriguez
Copy link

I want to clone repos to use on a different computer. How can I combine the clone repo steps in github with wflow_git_pull()? The idea is to use as many tools workflowr can provide as possible. Thanks.

@pcarbo
Copy link
Member

pcarbo commented Jan 28, 2023

That's a great question! I'm not sure… @jdblischak?

@jdblischak
Copy link
Member

The Git-related functions like wflow_git_pull() are mostly powered by the git2r package. I created the convenience functions like wflow_git_pull() since using git2r::pull() would require a workflowr user to invest time learning how the git2r package works.

However, git2r::clone() is essentially the same as its equivalent git clone. Here's an example of how you could programmatically clone and update one of your existing workflowr repos:

library(git2r)
clone("https://github.com/ogorodriguez/013_tidymodels-practice-various.git",
  local_path = "013_tidymodels-practice-various")
setwd("013_tidymodels-practice-various")
wflow_git_pull()
# entered GitHub username and password

## Summary from wflow_git_pull
## 
## Pulling from the branch "master" of the remote repository
## "origin" 
## 
## Using the HTTPS protocol
## The following Git command was run:
## 
##   $ git pull origin master
## 
## No changes were made because your local and remote
## repositories are in sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants