Skip to content

Instantly share code, notes, and snippets.

@kmikodev
Created February 9, 2025 14:42
Show Gist options
  • Save kmikodev/7e44aaf8d37cfe4bd239badd142296ce to your computer and use it in GitHub Desktop.
Save kmikodev/7e44aaf8d37cfe4bd239badd142296ce to your computer and use it in GitHub Desktop.
🚀 Git Power Aliases - Streamline your Git workflow with a comprehensive collection of time-saving aliases and powerful functions
# Git Aliases
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gst='git status'
alias gp='git push'
alias gpush='git push'
alias gpull='git pull'
alias gpl='git pull'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcm='git commit -m'
alias gcam='git commit -am'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gm='git merge'
alias gpl='git pull'
alias gplo='git pull origin'
alias gplom='git pull origin main'
alias gp='git push'
alias gpo='git push origin'
alias gpom='git push origin main'
alias gd='git diff'
alias gl='git log'
alias glg='git log --graph --oneline --decorate'
alias gs='git stash'
alias gsp='git stash pop'
alias gsl='git stash list'
alias grb='git rebase'
alias grs='git reset'
alias grh='git reset --hard'
alias gcl='git clone'
alias gf='git fetch'
alias gfa='git fetch --all'
# Git Flow Aliases (si usas git-flow)
alias gfi='git flow init'
alias gff='git flow feature'
alias gffs='git flow feature start'
alias gfff='git flow feature finish'
alias gfr='git flow release'
alias gfrs='git flow release start'
alias gfrf='git flow release finish'
alias gfh='git flow hotfix'
alias gfhs='git flow hotfix start'
alias gfhf='git flow hotfix finish'
# Aliases personalizados comunes
alias gdev='git checkout develop'
alias gmain='git checkout main'
alias gmaster='git checkout master'
alias greset='git reset --hard HEAD'
alias gclean='git clean -fd'
alias gpristine='git reset --hard && git clean -dfx'
# Funciones útiles
function gac() {
git add --all && git commit -m "$1"
}
function gacp() {
git add --all && git commit -m "$1" && git push
}
# Función para crear una nueva rama y hacer checkout
function gcob() {
git checkout -b "$1"
}
# Función para hacer pull de una rama específica
function gplb() {
git pull origin "$1"
}
# Función para hacer push de una rama específica
function gpb() {
git push origin "$1"
}

🚀 Git Power Aliases

A comprehensive collection of Git aliases designed to significantly boost your daily productivity.

✨ Features

  • Shorter, memorable commands
  • No need to type 'git' before each command
  • Useful functions for combining common operations
  • Git Flow support
  • Custom aliases for common workflows

🛠 Installation

  1. Copy the content of .bashrc-git-aliases
  2. Paste it at the end of your ~/.bashrc (for Bash) or ~/.zshrc (for Zsh)
  3. Reload your configuration:
    source ~/.bashrc   # for Bash
    # or
    source ~/.zshrc    # for Zsh

📜 Most Used Commands

  • gpush - git push
  • gpull - git pull
  • gst - git status
  • ga - git add
  • gaa - git add --all
  • gcm "message" - git commit -m
  • gco - git checkout
  • gb - git branch

⚡ Special Functions

  • gac "message" - add + commit in one step
  • gacp "message" - add + commit + push in one step
  • gcob branch-name - create and switch to new branch
  • gpb branch-name - push specific branch

🔄 Git Flow

Includes Git Flow aliases if you use it in your workflow:

  • gff - git flow feature
  • gfr - git flow release
  • gfh - git flow hotfix

🤝 Contributing

Suggestions and improvements are welcome! Feel free to fork and submit pull requests.

📝 License

MIT - Use it as you wish, share it with anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment