使用TortoiseGit自动推送 [英] automatic push using TortoiseGit

查看:255
本文介绍了使用TortoiseGit自动推送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用TortoiseGit手动推送更新.我想每天自动推送我的工作.有什么办法可以使用Task Scheduler或其他工具吗?非常感谢您的帮助.

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.

推荐答案

只需创建一个计划任务即可在命令库中运行

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

git push origin master

这里不需要使用TortoiseGit,因为推压不应由人来完成.

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

更新

git push origin master命令的作用:

  • push告诉git推送
  • origin告诉git要在哪个远程仓库上推送.克隆存储库时,原始存储库默认情况下指定为origin.所以我认为那是您想要推动的地方
  • master告诉git要推送哪个分支.在这里它将把您的master本地分支推送到远程存储库的master分支
  • 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.)

就这样:我们有一个命令可以在存储库中运行,以推送最新的提交.不,我们想每天自动运行它.在这里我们可以在Linux上使用cron,在Windows上使用计划任务.

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.

这里没什么麻烦的:只需创建一个计划任务(例如 http://windows.microsoft.com/zh-cn/windows/schedule-task#1TC=windows-7 ),并将其配置为每天在我们的存储库所在的目录中运行此命令.

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.

这篇关于使用TortoiseGit自动推送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆