下面是 git 中传统工作流程的描述。
是否有可能以某种方式在 R 中编写一个脚本,让 git 执行所有脚本?这样做是否明智?非常感谢!
cd <path_to_local_repository>。git add --all以暂存更改。git commit -m '<commit_message>'在命令行输入以将更改提交到本地存储库。git push 在命令行中输入,将更改推送到远程存储库(例如,在 Bitbucket 上)。“git2r”包提供了这种功能:https://docs.ropensci.org/git2r/reference/checkout.html
创建文件/目录和更改目录可以在基本 R 中使用 file.create 和 setwd 等完成
然后:
git2r::add(repo = ".", path = NULL, force = FALSE)
git2r::commit(repo = ".", message = "commit message")
git2r::push(credentials = whatever-you-need-for-pushing-to-bitbucket)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1637 次 |
| 最近记录: |