DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Automatically Push A Git Repo On Commit

10.27.2008
| 6360 views |
  • submit to reddit
        // description of your code here

cd my_repo
echo 'git push' > .git/hooks/post-commit
chmod 755 .git/hooks/post-commit
    

Comments

Bijay Rungta replied on Thu, 2010/07/08 - 10:36am

Seem to work fine when I commit from Command line, but when I commit any changes from my IDE, NetBeans, it doesn't push the changes.

Bijay Rungta replied on Thu, 2010/07/08 - 10:36am

Will this work for Windows? How to achieve this on Wondows?