Is it possible to push a git alias to a git repo so everyone that clones that repo can use that alias?
Example:
git config alias.st "status -s"
git push
Does the alias gets pushed?
PD: What I want to achieve is something to develop a several steps tutorial, so whenever I do "next" or "git next" it switches to the branch of the next level.
An alias is part of your local (system-level, user-level, or repo-level) config. Because you cannot share your local config via git push
, you cannot push an alias to a remote.
There is a good security reason for such a restriction: imagine if aliases got copied to the local config of anyone who cloned your repo and you had defined an alias equivalent to sudo rm -rf /
, encouraging people to use it. Mayhem would ensue...
What you can always do, however, if you want to share the definition of your alias with other people, is to push a commit that contains a text file with the definition of your alias in it.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments