Automatically pushing main branch to multiple repositories after each commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat .git/hooks/post-commit # <= change this file in your repo to automatiicaly execute after each commit | |
#!/bin/bash | |
cd /path/to/your/repo | |
git push gitlab master && git push github master && git push anotherserver master | |
# You may want to add your different remotes using: | |
# git remote add REMOTENAME git@server.domain:group/project.git #this is ssh example | |
# (and REMOTENAME above was gitlab, github, anotherserver...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://twitter.com/GWierzowiecki/status/1651660458942668807