Skip to content

Instantly share code, notes, and snippets.

@jayesh15111988
Last active February 15, 2023 15:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayesh15111988/9161305175a7f277872ec747812fb2f1 to your computer and use it in GitHub Desktop.
Save jayesh15111988/9161305175a7f277872ec747812fb2f1 to your computer and use it in GitHub Desktop.
My zshrc file
function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
COLOR_DEF=$'\e[0m'
COLOR_USR=$'\e[38;5;243m'
COLOR_DIR=$'\e[38;5;197m'
COLOR_GIT=$'\e[38;5;39m'
setopt PROMPT_SUBST
export PROMPT='${COLOR_USR}%n ${COLOR_DIR}%~ ${COLOR_GIT}$(parse_git_branch)${COLOR_DEF} $ '
alias gf='git push -f origin'
alias gu='git push -u origin'
alias gb='git branch'
alias unmerged="git branch --no-merged"
alias flog="git log --graph --pretty=oneline --abbrev-commit"
alias gd='git diff'
alias gdc='git diff --cached'
alias gs='git status'
alias gc='git checkout'
alias ga='git add . && git commit --amend --no-edit'
alias pi='killall Xcode && pod install && open Trip.xcworkspace'
alias viz='vi ~/.zshrc'
alias gpm='git pull origin main'
alias gmm='git merge main'
alias gcm='git checkout main'
alias grspm='git checkout -- Trip.xcworkspace/xcshareddata/swiftpm/Package.resolved && git checkout -- Trip.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved '
alias gfc='git add . && git commit -am "Fixed merge conflicts"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment