I've installed gitolite in my webfaction account with other user different from my main user. For example: gitoliteuser and myaccountuser. I have my git repositories in /home/gitoliteuser/repositories/repo.git And my webapp in /home/myaccountuser/webapps/repo I want to automatic pull my webapp when i push from local to my git. I've tried with: unset $(git rev-parse --local-env-vars) cd /home/demssite/webapps/top100 git pull origin develop But It doens't work cause i need to change user, but i don't know how. Can anybody help me about this? Thanks in advance. Diego asked 30 Aug '13, 04:42 demssite |
Hello, The main problem with your approach is that you are trying to perform the "git pull" as the wrong user. You need to perform that action as the 'myaccountuser', not 'gitoliteuser'. You can accomplish your goal by using ssh with keys. First, create SSH keys that enable automated logins from 'gitoliteuser' to 'myaccountuser':
Your 'gitoliteuser' should now be able to run commands like this without a password prompt:
Once you get that working, you would put something like this into your gitolite repository's post-commit and post-receive hooks (or just make one a symlink of the other):
After that, your webapp's repository and workarea will be synchronized with the gitolite repo automatically. Any questions? ~Christopher S, WebFaction Support answered 30 Aug '13, 14:40 likebike |