Posts

Showing posts with the label cli

Useful aliases

alias ll="ls -lah" alias branch="git branch" alias checkout="git checkout" commit() { echo "Enter commit message (Ctrl+D to finish):" msg=$(cat) git commit -m "$msg" } add() { # Ensure git repo git rev-parse --is-inside-work-tree >/dev/null 2>&1 || return 0 # Colors GREEN="\e[32m" RED="\e[31m" YELLOW="\e[33m" CYAN="\e[36m" BOLD="\e[1m" RESET="\e[0m" local current_branch remote_branch behind local files file answer local added_files=() local skipped_files=() local temp_ignored_files=() local existing_temp_ignored=() current_branch=$(git branch --show-current) # ---------- STEP 0: Check existing temp-ignore files ---------- mapfile -t existing_temp_ignored /dev/null 2>&1 || { echo -e "${RED}Fetch failed.${RESET}" return 1 } behind=$(git rev-list --count HEAD.."$remote_branch" ...