Basically, when I push something to GitLab (or other services), these scripts commit with an empty message and push to GitHub. That's all.
Connect to GitHub via ssh to the smooth experience. If you don't know that, check out now from the GitHub Docs.
Fork this repository and clone the forked repository to local. (If you are lazy, run cd $HOME
commands before git clone
command because of the default path.)
You have to make executable the sh files.
sudo chmod +x /path/to/commitToGitHub.sh
sudo chmod +x /path/to/pushToGitHub.sh
Check out the file path from pushToGitHub.sh:7 and commitToGitHub.sh:7 then (if you need to this) customize for yourself. (default file path="/home/<your_username>/pushToGitHub/")
Set the aliases in .bashrc (or .zshrc etc.) to the smooth experience.
alias gcmsg2="~/pushToGitHub/commitToGitHub.sh && git commit -m"
alias gp2="git push && ~/pushToGitHub/pushToGitHub.sh"