Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git --- How to schedule `git push` on linux?

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

  • tell git to make push at a specified time
  • 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.).

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

like image 857
Yosh Avatar asked Nov 25 '13 09:11

Yosh


2 Answers

There is nothing in git which includes:

  • scheduling (this is provided by Ubuntu with cron jobs)
  • authentication: it depends on the kind of listener (https, ssh, git, ...) you have on the remote side.

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

  • use a dedicate public/private ssh key.
  • use encrypted credentials (username/password) with https url (as in "Configure Git clients, like GitHub for Windows, to not ask for authentication")
like image 142
VonC Avatar answered Nov 16 '22 01:11

VonC


you can schedule such jobs using cron.

00 07 * * * git push

will run git push command everyday at 7 AM.

like image 21
0xc0de Avatar answered Nov 16 '22 00:11

0xc0de