Last active
November 25, 2024 17:24
-
-
Save rhcarlosweb/6f24a88defc2a56cf7e61d5543c2ed2a to your computer and use it in GitHub Desktop.
GitConfig Alias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| # Shorthand for checkout | |
| co = checkout | |
| # Shorthand for branch | |
| br = branch | |
| # Shorthand for commit | |
| ci = commit | |
| # Shorthand for status | |
| st = status | |
| # Hide file from Git tracking | |
| hide = update-index --assume-unchanged | |
| # Unhide previously hidden file | |
| unhide = update-index --no-assume-unchanged | |
| # Remove file from staging area | |
| unstage = reset HEAD -- | |
| # Show last commit | |
| last = log -1 HEAD | |
| # Shorthand for push | |
| ps = push | |
| # Add all changes and commit with message | |
| ca = !git add -A && git commit -m | |
| # Show all branches including remote | |
| ba = branch -a | |
| # Show detailed status | |
| stat = status -sb | |
| # Show commit history with graph | |
| lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
| # Undo last commit but keep changes | |
| undo = reset HEAD~1 --soft | |
| # Show diff of staged changes | |
| ds = diff --staged | |
| # Pull with rebase | |
| pr = pull --rebase | |
| # Push force with lease (safer than force push) | |
| pf = push --force-with-lease | |
| # List all aliases | |
| alias = config --get-regexp ^alias\\. | |
| # Amend commit without editing message | |
| amend = commit --amend --no-edit | |
| # Clean untracked files and directories | |
| cleanup = clean -fd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment