【发布时间】:2018-05-21 13:33:37
【问题描述】:
我正在开发 word 和 excel 宏,但是为了保持修订控制和跟踪更改,我想使用 GitLab
所以到目前为止我所做的是有一个代码,当我运行我的发布子例程时,它会将所有 vba 代码导出到我的 PC 上的文件夹(Z:/Dokumentstyring/GIT):
Private Sub publish()
ThisDocument.save
Call ExportVisualBasicCode
' Here I would like to automatically push the code to GIT
Call CloseAll
End Sub
然后我手动进入 git shell 并输入:
git config --global user.name "xxxxx"
git config --global user.email "xxxx@xxxx.com"
cd Z:/Dokumentstyring/GIT
git init
git remote add origin xxxxxx/xxx/Dokumentstyring.git
git add .
git commit -m "Version Number - Date and a short comment"
git push -u origin master
有没有办法让我的发布例程手动为我工作?
【问题讨论】:
-
我听不懂你的问题。您知道,一旦设置了存储库,您就不需要每次都运行代码,从您在问题中提到的上述代码中,您只需要运行最后 3 行。如果你解释更多你想要什么,我可能会帮助你