automatic push using TortoiseGit

拥有回忆 提交于 2020-01-06 15:50:49

问题


I am pushing update manually using TortoiseGit. I want to push my work automatically daily basis. Is there any way using Task Scheduler or other ? I really appreciate your help.


回答1:


Just create a scheduled task that will run in your repository the command

git push origin master

No need to use TortoiseGit here since the push isn't supposed to be done by a human.


update

What the command git push origin master does:

  • push tells git to push
  • origin tells git on which remote repo to push. When you clone a repo, the original one is by default designated as origin. So I assume that's where you want to push
  • master tells git which branch to push. Here it will push your master local branche to the master branch of the remote repository

(Obviously you may want to adapt part of that command if you want to push elsewhere / another branch.)

So this is it: we have a command we can run in our repo in order to push our latest commit. No we want to run it automatically on a daily basis. This is where we could use a cron on Linux, or a scheduled task on Windows.

Nothing tricky here: just create a scheduled task (eg http://windows.microsoft.com/en-us/windows/schedule-task#1TC=windows-7) and configure it to run this command, daily, in the directory where our repo is.



来源:https://stackoverflow.com/questions/35672327/automatic-push-using-tortoisegit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!