Git从脚本推送到另一个仓库

时间:2019-07-14 10:41:15

标签: git

假设我有:

DF1 <-
  data.frame(
    Factor1 = c(1, 2, 4),
    Factor2 = c(3, 1, 1),
    Factor3 = c(9, 1, 0)
  ) %>%
  mutate(max_ind = pmap_int(list(Factor1, Factor2, Factor3), ~which.max(c(...))))

我想做的是以编程方式从我的脚本中将最新代码从 Factor1 Factor2 Factor3 max_ind 1 1 3 9 3 2 2 1 1 1 3 4 1 0 1 推送到 1. github repo https://github.com/user1/repo1 2. And I have gitlab repo (user2) https://gitlab.com/user2/repo2

repo1

它应该像这样

我运行脚本(例如repo2),并指定输入参数:

-Let's presume I always use login and password Auth, user1 and user2 have different passwords
-I don't want to save the original commit history of repo1(that's important). 
-Author of the commit in repo2 should be user2

还有我的脚本

  1. 授权为pusher.py,从user1, password1, user2, password2, origin1, origin2, commit_message 提取代码

  2. user1的身份注销并授权,以repo1的身份提交并推送到user2

我该怎么做? 也许您可以共享git命令列表来做到这一点。 现在我在想

1。验证为repo2,提取存储库,以编程方式将代码复制到另一个文件夹。 按照建议的here退出

user2

2。验证为user1并提交并推送到新仓库

还有更好的方法吗?

0 个答案:

没有答案
相关问题