git log --graph --all --decorate --pretty=format:"%C(auto)%h%d %s %C(green)(%an)" how to…
- User
git log --graph --all --decorate --pretty=format:"%C(auto)%h%d %s %C(green)(%an)"
how to add alias for this command in zshn
- Assistant
To create an alias for a command in
zsh, you can add it to your~/.zshrcfile. Here is how you can add an alias for the command you mentioned:-
Open your
~/.zshrcfile in a text editor. You can usenano,vim, or any text editor of your choice. Here's how you can do it withnano:nano ~/.zshrc -
Add the following line to the file to set up the alias:
alias gitlg='git log --graph --all --decorate --pretty=format:"%C(auto)%h%d %s %C(green)(%an)"'Here,
gitlgis the name of the alias. You can replace it with any name you prefer. -
Save the changes and exit the editor. If you're using
nano, you can do this by pressingCtrl + Oto save, andCtrl + Xto exit. -
To apply the changes, either restart your terminal or source the
~/.zshrcfile with the following command:source ~/.zshrc
Now, you can use (or whatever alias name you chose) to run the command. This alias will now produce the output formatted as specified whenever you use it.
-