You may using git hook to do so.
First, locate your hook folder:
git config --list
#...
#core.hookspath=~/shared-git-hooks
Or set it using the following command:
git config core.hookspath ~/shared-git-hooks
Create a hook file contains scripts
touch ~/shared-git-hooks/post-commit
#post-commit file
git push ...
After set it, once you commit will run the script inside post-commit.
You may see more details for git hook here:
https://git-scm.com/book/gr/v2/Customizing-Git-Git-Hooks
Hope it can help.
The script may look like:
#This script will push master to all existing remote
#git remote add repo2 https://github.com/repo2.git
#git remote add repo3 https://github.com/repo3.git
for remote in $(git remote); do git push $remote master; done;
Also please note that if you want to trigger it when push then need to use pre-push
hook instead of post-commit
One more thing, if you want only doing this stuff on specific project / repository, then you may need to check the project location first.
if [ "$(pwd)" == "/your/project/path" ]; then
for remote in $(git remote); do git push $remote master; done;
fi