Discussion:
[pass] pass git pull before every commit
Mikhail Gorbulev
2015-03-19 09:58:48 UTC
Permalink
Hi,

is there any way to set add a hook to pass to (optionally?) make "pass
git pull" before every "pass git commit" and "pass git push" after? This
could be handy in order to always have password synchronized via git.
Of course it might cause problems with merging, but I think it might be
solved via standart git mergin mechanism.

Thanks,
M.
Steven Bambling
2015-03-19 10:14:53 UTC
Permalink
This could be accomplished by a pre-commit hook script that would be as simple at just performing a (git pull), but you may want to look at something like (https://github.com/aanand/git-up <https://github.com/aanand/git-up>) depending on your workflow.

The you can use a post-commit hook to perform the push to your ‘remote’ repository.

Additionally you may want to consider a post-receive hook if you want to have a cold ‘remote’ repository. This would do something like trigger another box to pull from the hot ‘remote’ repository.

STEVE
Hi,
is there any way to set add a hook to pass to (optionally?) make "pass git pull" before every "pass git commit" and "pass git push" after? This could be handy in order to always have password synchronized via git.
Of course it might cause problems with merging, but I think it might be solved via standart git mergin mechanism.
Thanks,
M.
_______________________________________________
Password-Store mailing list
http://lists.zx2c4.com/mailman/listinfo/password-store
Lenz Weber
2015-03-19 11:40:51 UTC
Permalink
this is a simple post-commit hook that has been recommended here from
time to time:

git pull --rebase
git push

(in ~/.password-store/.git/hooks/post-commit - don't forget to chmod +x)
Post by Mikhail Gorbulev
Hi,
is there any way to set add a hook to pass to (optionally?) make "pass
git pull" before every "pass git commit" and "pass git push" after? This
could be handy in order to always have password synchronized via git.
Of course it might cause problems with merging, but I think it might be
solved via standart git mergin mechanism.
Thanks,
M.
_______________________________________________
Password-Store mailing list
http://lists.zx2c4.com/mailman/listinfo/password-store
Mikhail Gorbulev
2015-04-02 11:48:33 UTC
Permalink
Thanks, guys. That's quite a good solution.

M.
Post by Lenz Weber
this is a simple post-commit hook that has been recommended here from
git pull --rebase
git push
(in ~/.password-store/.git/hooks/post-commit - don't forget to chmod +x)
Post by Mikhail Gorbulev
Hi,
is there any way to set add a hook to pass to (optionally?) make "pass
git pull" before every "pass git commit" and "pass git push" after? This
could be handy in order to always have password synchronized via git.
Of course it might cause problems with merging, but I think it might be
solved via standart git mergin mechanism.
Thanks,
M.
_______________________________________________
Password-Store mailing list
http://lists.zx2c4.com/mailman/listinfo/password-store
_______________________________________________
Password-Store mailing list
http://lists.zx2c4.com/mailman/listinfo/password-store
--
Best wishes, me.
Hugo Osvaldo Barrera
2015-04-05 06:19:46 UTC
Permalink
Post by Lenz Weber
this is a simple post-commit hook that has been recommended here from
git pull --rebase
git push
(in ~/.password-store/.git/hooks/post-commit - don't forget to chmod +x)
Very simple solution, I feel really stupid for not having though of that
before.

How safe is it do change this to

(git pull --rebase && git push) &

so that it runs in background? (I'd like my terminal back right away, instead
of having to wait for the pull/push to complete).

Are there chances of me breaking stuff it I run `pass` before the background
process finishes?
Post by Lenz Weber
Post by Mikhail Gorbulev
Hi,
is there any way to set add a hook to pass to (optionally?) make "pass
git pull" before every "pass git commit" and "pass git push" after? This
could be handy in order to always have password synchronized via git.
Of course it might cause problems with merging, but I think it might be
solved via standart git mergin mechanism.
Thanks,
M.
_______________________________________________
Password-Store mailing list
http://lists.zx2c4.com/mailman/listinfo/password-store
_______________________________________________
Password-Store mailing list
http://lists.zx2c4.com/mailman/listinfo/password-store
--
Hugo Osvaldo Barrera
A: Because we read from top to bottom, left to right.
Q: Why should I start my reply below the quoted text?
Continue reading on narkive:
Loading...