Posts

Showing posts with the label cli

Useful aliases

alias ll="ls -lah" alias branch="git branch" alias checkout="git checkout" add() { # Colors GREEN="\033[32m" RED="\033[31m" YELLOW="\033[33m" BLUE="\033[34m" RESET="\033[0m" # Arrays for summary added_files=() skipped_files=() # Get changed files (including renamed, deleted, etc.) mapfile -t files commit() { echo "Enter commit message (Ctrl+D to finish):" msg=$(cat) git commit -m "$msg" } git_push() { # Colors RED="\033[0;31m" GREEN="\033[0;32m" CYAN="\033[0;36m" YELLOW="\033[1;33m" NC="\033[0m" CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" git fetch origin "$CURRENT_BRANCH" >/dev/null 2>&1 echo -e "${CYAN}Commits to push on $CURRENT_BRANCH:${NC}" git log origin/$CURRENT_BRANCH..$CURRENT_BRANCH --oneline || echo "No upstream ...