git - 如何在linux上安排`git push`?

时间:2021-02-20 16:24:29

I think the title describes my problem well: I want to schedule git push. To be more specific, I'd like to know how I can either

我认为标题很好地描述了我的问题:我想安排git push。更具体地说,我想知道我怎么做

  • tell git to make push at a specified time
  • 告诉git在指定时间进行推送

  • tell OS to execute git push at a specified time without re-authentication (preferably, in such a way that the other attempts to push shall require authentication.).
  • 告诉操作系统在指定的时间执行git push而不重新认证(最好是其他尝试推送的方式需要认证)。

I'm on linux (Ubuntu 13.04) and thus scripting with bash will be fine.

我在linux上(Ubuntu 13.04)因此使用bash编写脚本会很好。

2 个解决方案

#1


3  

There is nothing in git which includes:

git中没有任何内容包括:

  • scheduling (this is provided by Ubuntu with cron jobs)
  • 调度(这是由Ubuntu提供的cron作业)

  • authentication: it depends on the kind of listener (https, ssh, git, ...) you have on the remote side.
  • 身份验证:它取决于您在远程端的侦听器类型(https,ssh,git,...)。

Depending on your remote url, you can, for instance:

根据您的远程URL,您可以,例如:

#2


0  

you can schedule such jobs using cron.

你可以使用cron安排这样的工作。

00 07 * * * git push

will run git push command everyday at 7 AM.

将在每天上午7点运行git push命令。

#1


3  

There is nothing in git which includes:

git中没有任何内容包括:

  • scheduling (this is provided by Ubuntu with cron jobs)
  • 调度(这是由Ubuntu提供的cron作业)

  • authentication: it depends on the kind of listener (https, ssh, git, ...) you have on the remote side.
  • 身份验证:它取决于您在远程端的侦听器类型(https,ssh,git,...)。

Depending on your remote url, you can, for instance:

根据您的远程URL,您可以,例如:

#2


0  

you can schedule such jobs using cron.

你可以使用cron安排这样的工作。

00 07 * * * git push

will run git push command everyday at 7 AM.

将在每天上午7点运行git push命令。