简体   繁体   English

Git拉/取自动化

[英]Git Pull/Fetch Automation

I'm wanting to automate a local server to pull github repositories and then add copyrights to the code files, if they aren't already there, then commit and push them back. 我想自动化本地服务器以提取github存储库,然后将版权添加到代码文件中(如果还没有版权的话),然后提交并推回它们。 I have the copyright executable running on the linux centOS server, but I can't get a way to tell my program to run or not. 我的版权可执行文件可以在linux centOS服务器上运行,但是我无法告诉程序是否运行。 Webhooks don't work since its a local server, not web-facing, any ideas? Webhooks无法运行,因为它是本地服务器,而不是面向Web的任何想法?

My first thought is that you could write a script to do this. 我的第一个想法是,您可以编写一个脚本来执行此操作。 The easiest would be to use a shell script or a python script. 最简单的方法是使用Shell脚本或python脚本。

The script could do the following. 该脚本可以执行以下操作。

Open every directory
   for each directory
       for each file in the directory
            if not contains copyright
                add copyright to top of file

git commit -m "add copyright"
git push

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM