I saw a screencast where someone had gotten
git st git ci
to work. When I do it I get an error asking me if I meant something else.
Being a git newb, I need to know what you have to do to get this done?
It is important to note that there is no direct git alias command. Aliases are created through the use of the git config command and the Git configuration files. As with other configuration values, aliases can be created in a local or global scope.
Your git aliases are often stored per your user's configuration at ~/. gitconfig . You can also manually set aliases using, for example, the command git config alias. s 'status -s' .
2.7 Git Basics - Git Aliases This means that, for example, instead of typing git commit , you just need to type git ci . As you go on using Git, you'll probably use other commands frequently as well; don't hesitate to create new aliases.
Basically you just need to add lines to ~/.gitconfig
[alias] st = status ci = commit -v
Or you can use the git config alias command:
$ git config --global alias.st status
On unix, use single quotes if the alias has a space:
$ git config --global alias.ci 'commit -v'
On windows, use double quotes if the alias has a space or a command line argument:
c:\dev> git config --global alias.ci "commit -v"
The alias command even accepts functions as parameters. Take a look at aliases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With