Windows git https way how to achieve simultaneous push to multiple repositories, and according to each repository set a separate submission username
[remote "github"]
url = https://github.com/jock/test
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "gitlab"]
url = https://gitlab.com/test
fetch = +refs/heads/*:refs/remotes/origin/*|
How do I set up the respective commit user names for github gitlab
github :github-username
gitlab: gilab-username
if you need to change only the alias, try these steps. I tried different versions a few years ago, hope that works.
[remote "github"]
url = https://github.com/jock/test
fetch = +refs/heads/*:refs/remotes/github/*
[remote "gitlab"]
url = https://gitlab.com/test
fetch = +refs/heads/*:refs/remotes/gitlab/*
touch .git/hooks/pre-push
chmod +x .git/hooks/pre-push
#!/bin/sh
remote="$1"
if [ "$remote" = "github" ]; then
git config user.name "github-username"
git config user.email "github-email@example.com"
elif [ "$remote" = "gitlab" ]; then
git config user.name "gitlab-username"
git config user.email "gitlab-email@example.com"
fi
git push github
git push gitlab
[alias]
multipush = "!f() { git push github && git push gitlab; }; f"
git multipush