How to set up automatic pressing?

How to configure auto click in Mercurial and Git? Sometimes I forget to click on the computer, and when I move my location, I do not agree with the good code. Is there a way for mercurial and git to do this every hour, for example?

+9
git mercurial
01 Oct 2018-10-10
source share
3 answers

In mercurial you put this in your .hg/hgrc

 [hooks] commit = hg push 
+9
01 Oct 2018-10-10
source share

With git, you can use the post-commit hook to push after each commit. To do this, you need to add the post-commit script executable to the .git/hooks directory. For example,

 #!/bin/sh # # An example hook script that is called after a successful # commit is made. # # To enable this hook, rename this file to "post-commit". git push --mirror remote 

Where remote refers to the name of the remote repo you click on.

You can also configure cron to run this script every hour if you wish.

Update

Mercurial also has hooks (but of course). Here is the relevant documentation . I have not used Mercurial, so you have to decide for yourself.

+20
Oct 01 2018-10-01
source share

As an alternative, I created a live-git-push package that will be used in courses and the like.

It will synchronize the repo in real time with local file changes, committing and clicking on each file save.

Try live-git-push .

0
Dec 17 '18 at 10:05
source share



All Articles