简体   繁体   English

从Android Studio自动提交并推送到GitHub

[英]Automatic Commit and Push to GitHub from Android Studio

I have been working in Android Studio for more than 2 years. 我已经在Android Studio中工作了2年以上。 I used to create a repository in GitHub and commit files manually using the built in VCS in Android Studio. 我曾经在GitHub中创建存储库,然后使用Android Studio中内置的VCS手动提交文件。 But I need to know if the commit and push process can be automatically done every 5 or 10 minutes after establishing the initial commit. 但是我需要知道在建立初始提交后每5或10分钟是否可以自动完成提交和推送过程。 I have researched and was clueless on this issue. 我已经研究过,对这个问题一无所知。 If there is any way or a plugin to do this, it would be great. 如果有任何方法或插件可以做到这一点,那就太好了。

There is not such feature for git and android studio (or plugin) themselves. git和android studio(或插件)本身没有这种功能。

And if you really need this feature, you can use your own script and schedule to run the script on your local machine. 并且,如果您确实需要此功能,则可以使用自己的脚本并计划在本地计算机上运行该脚本

For example, you can use a shell script to commit and push changes: 例如,您可以使用Shell脚本来提交和推送更改:

#!/bin/bash

git add .
git commit -m 'message'
git push

And then auto run the script as these methods show: 然后自动运行脚本,如以下方法所示:

schedule running a bash shell script in windows 安排在Windows中运行bash shell脚本

Running .sh every 5 minutes 每5分钟运行一次.sh

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

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