# What Git aliases are in your bashrc? Many open source users love a good [Bash alias](https://opensource.com/article/20/1/bash-scripts-aliases) and are usually happy to show off a particularly robust [.bashrc](https://opensource.com/article/18/9/handy-bash-aliases) file when given the chance. If you're a frequent user of Git, you might benefit from a few Git aliases mixed in with your other Bash aliases. Alternately, you can create aliases specific to Git with this `git config` command. This example sets `git co` command to `git checkout`. ```bash $ git config --global alias.co checkout ``` ## Aliases Here's an easy way to see just the most recent log entry: ```bash git config alias.last 'log -1 HEAD' ``` Opensource.com author Sachin Patil uses `hist` for reviewing logs: ``` log --pretty=format:'%h %ai [%an] %s%d' --graph ``` Sachin creates these Bash aliases for pull requests: ```bash # github pull request. # Usage: git pr pr="\!sh -c 'git fetch $1 pull/$2/head:$3 && git checkout $3' -" ``` The `git diff` command is useful for all kinds of comparisons, but sometimes all you really want is the file name of what's changed. Kristen Pol creates an alias to shorten the `--name-only` option: ```bash git diff --name-only ``` Kristen says "We typically have a lot of development happening simultaneously, so knowing the most recent commit across all branches is handy. Here's another command I have aliased:" ```bash git branch --remotes --verbose --sort=-committerdate ``` Everybody can appreciate a fresh start. This is Kristen's alias for wiping out a branch so it's super fresh and clean: ```bash alias gitsuperclean='git reset --hard; git clean --force -d -x' ``` ## filter-repo [Chris](https://opensource.com/users/jazzsequence) has been using a ["third-party" Git command](LINK TO SETH'S GIT CUSTOM COMMAND ARTICLE) called [git-filter-repo](https://github.com/newren/git-filter-repo). "Ever want to pull a specific directory out of a larger git repository and make it its own, separate repo, while keeping all the Git history? That's exactly what filter-repo does." ## Your aliases What do you use so often that you alias it? Do you use Bash aliases or Git aliases, or a mix of both? Tell us in the comments!