Super git with zshrc:
Easy Customization
Hi all! So, straight to the point:
Customizing Terminal Logs and Git Commands with `zshrc`
1. Prompt Customization
Enhance your prompt to show the current directory, Git branch, or even introduce emojis.
In .zshrc file
PROMPT=’%F{cyan}%d %F{yellow}$(git_branch) %F{white}➜ %f’
Here, `%d` represents the current directory, `$(git_branch)` fetches the active Git branch, and the `%F{color}` directives adjust the text color.
2. Function Logging
Craft functions to record specific tasks for better clarity and rapid debugging.
#.zshrc
my_log(){
echo “«%F{green}[LOG – $(date +»%T»)]%f $1"
}
alias log=my_log
By invoking `log «My custom message»`, you’ll now see a timestamped log message.
3. Enhancing the Git Push Experience
Daily Git tasks can be simplified and made more efficient with customizations:
- Git Aliases: Define concise and memorable shortcuts for frequently used Git commands.
# .zshrc
alias gs=’git status’
alias ga=’git add’…