# Git aliases

Published articles for Git aliases.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Git hacks - a set of my favorite git aliases

DevFeed: [Git hacks - a set of my favorite git aliases](<https://devfeed.tech/articles/git-hacks-a-set-of-my-favorite-git-aliases-27686.md>)

Original publisher: [Read original article](<https://gagor.pro/2024/01/git-hacks-a-set-of-my-favorite-git-aliases/>)

Author: Tom

Published: 2024-01-27T00:00:00Z

Content type: article

Language: en

Sources: [Tomasz Gągor](<https://devfeed.tech/sources/tomasz-gagor.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [bitbucket](<https://devfeed.tech/topics/bitbucket.md>), [pull-requests](<https://devfeed.tech/topics/pull-requests.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [bitbucket](<https://devfeed.tech/tags/bitbucket.md>), [commands](<https://devfeed.tech/tags/commands.md>), [commit](<https://devfeed.tech/tags/commit.md>), [git](<https://devfeed.tech/tags/git.md>), [git-aliases](<https://devfeed.tech/tags/git-aliases.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>)

### AI overview

An overview of the author's favorite Git aliases for simplifying status and log checks, commits, branch management, reverts, and Bitbucket navigation. The article also describes aliases for extracting Jira ticket numbers and managing commit messages.

### Source excerpt

I use Git a lot, even writing this article i will commit text few times. There's a set of aliases I rely on daily and they're first I add in new place. Some Git commands are unnecessarily verbose. You can make your life much easier with bash-completions, but if you write it tens of times per day, it's anyway a lot of typing... and I'm a lazy man 😄 Simple status/log checks git s s = status --short --branch --untracked-files Shows a short, branch-focused status with untracked files.

## Automatically add ticket ID to every commit message in Git

DevFeed: [Automatically add ticket ID to every commit message in Git](<https://devfeed.tech/articles/automatically-add-ticket-id-to-every-commit-message-in-git-27667.md>)

Original publisher: [Read original article](<https://gagor.pro/2021/11/automatically-add-ticket-id-to-every-commit-message-in-git/>)

Author: Tom

Published: 2021-11-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Gągor](<https://devfeed.tech/sources/tomasz-gagor.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [Automation](<https://devfeed.tech/topics/automation.md>)

Tags: [add-ticket-id-to-commit](<https://devfeed.tech/tags/add-ticket-id-to-commit.md>), [automation](<https://devfeed.tech/tags/automation.md>), [bash](<https://devfeed.tech/tags/bash.md>), [commit](<https://devfeed.tech/tags/commit.md>), [commit-message-best-practices](<https://devfeed.tech/tags/commit-message-best-practices.md>), [git](<https://devfeed.tech/tags/git.md>), [git-aliases](<https://devfeed.tech/tags/git-aliases.md>), [git-automation](<https://devfeed.tech/tags/git-automation.md>), [git-commit-message](<https://devfeed.tech/tags/git-commit-message.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [jira-integration](<https://devfeed.tech/tags/jira-integration.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>)

### AI overview

A tutorial explains how to use custom Git aliases to read a ticket ID from the branch name and automatically prefix commit messages with it. Commits fail when no ticket ID is available.

### Source excerpt

Learn how to automatically add ticket IDs to every commit message in Git, ensuring consistent and informative commit history by using custom Git aliases.

## Some useful git aliases

DevFeed: [Some useful git aliases](<https://devfeed.tech/articles/some-useful-git-aliases-33368.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2011/05/13/some-useful-git-aliases>)

Published: 2011-05-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [Submodules](<https://devfeed.tech/topics/submodules.md>)

Tags: [config](<https://devfeed.tech/tags/config.md>), [git](<https://devfeed.tech/tags/git.md>), [git-aliases](<https://devfeed.tech/tags/git-aliases.md>), [global](<https://devfeed.tech/tags/global.md>), [graph](<https://devfeed.tech/tags/graph.md>), [submodules](<https://devfeed.tech/tags/submodules.md>), [useful](<https://devfeed.tech/tags/useful.md>)

### AI overview

A collection of Git aliases for displaying formatted repository history, pulling updates for a repository and its submodules, and resetting repositories to a clean state by removing changes and untracked or ignored files.

### Source excerpt

Git aliases are a great way to do more with less typing. Our team uses submodules to an extent which can sometimes be confusing. Some of these aliases help to clarify behavior. These are a few of my favorites.git lgThis gives you a nicely formatted semi-graphical log view with users, branches, and remotesgit config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C(green)%an%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" git latestThis does a git pull on the current repository as well as all submodulesgit config --global alias.latest '!sh -c "git pull && git submodule foreach \"git pull\""'git virgin (getting to a pure state)This will reset your changes and delete all untracked and ignored files (includes bin/ and obj/ directories)git config --global alias.virgin '!sh -c "git reset HEAD --hard && git clean -fXd && git clean -fd"'git harem (a whole lot of virgins)This does a virgin for your repository as well as all submodulesgit config --global alias.harem '!sh -c "git virgin && git submodule \"git harem\""'