0

When I commit some changes by git or mercurial, I would like to automatically backup (or do similar changes) in another place (backup directory for this project.)

Is it possible?

Don't Panic
  • 41,125
  • 10
  • 61
  • 80
EugenUngurean
  • 429
  • 3
  • 14

1 Answers1

0

I found solution. In folder .hg I created myhook.sh file and I changed hgrc. I have done in this way:

.hg/hgrc: 
[hooks]
commit =/fullPathToMyHook/myhook.sh

myhook.sh:
hg pull /pathToMyBackUpProject
hg merge
hg update
hg push /pathToMyBackUpProject

Now, then I write

hg commit
it automatically: commit my changes, get last changes from my backup storage, merge it, update and push all changes to backup storage.
EugenUngurean
  • 429
  • 3
  • 14