When using Git on multiple workstations, and for different Git repositories, it is convenient to have the same set of aliases available.
So, to synchronize the Git aliases across different workstations, and across different repositories, I consider putting the aliases in a shared Git repository on GitHub, but I am now certain how that can be done, or if that is the best way.
How to share Git aliases across multiple workstations?
Note: The answer at "Git aliases that are stored in origin" has some good input, but it does not directly address the question of how to share Git aliases across different Git repositories.
Its possible with just maintaining shared global
.gitconfigacross multiple workstations!! It can be done easily by setting up alias4git on target workstations.Clone alias4git
Update paths in file
alias.gitconfigto appropriate path of cloned alias4git repositoryUse
git cfgcommand to add new aliases instead of standardgit configcommandfor example,
(Note that
git cfgcommand modifiesalias4git/alias.gitconfiginstead of actually modifying global.gitconfigfile !!)Commit and push your changes in
alias4git/alias.gitconfigto alias4git repositoryUpdate
alias4git/alias.gitconfigon all other workstations by syncing alias4git repositoryAs
alias4git/alias.gitconfigfile now works as replacement for global.gitconfig, it works for all the git repositories, across multiple workstations and across multiple git users.Hope this answers your question!