Aliases - gecko-8/devwiki GitHub Wiki

Up

Aliases are created with the following console command:

git config --global alias.<command name> '<command>'

Useful Commands

Combine add, commit, and push commands into a single command

Windows

git config --global alias.acp '!f() { git add . && git commit -m \"$@\" && git push origin HEAD; }; f'

Linux

git config --global alias.acp '!f() { git add . && git commit -m "$@" && git push origin HEAD; }; f'

Usage

git acp "<commit message>"

Note: If you get an "Authentication failed" error, manually do the "git push " command. This will trigger the authentication flow. The add/commit section will have worked fine.

Delete a Branch from Local and Remote

Windows

git config --global alias.dbranch '!f() { git branch -d \"$@\" && git push origin --delete \"$@\"; }; f'

Linux

git config --global alias.dbranch '!f() { git branch -d "$@" && git push origin --delete "$@"; }; f'

Usage

git dbranch <branch name>

⚠️ **GitHub.com Fallback** ⚠️