Skip to content

Git aliases

VirtualMaestro edited this page Dec 5, 2019 · 6 revisions

Here the list of the useful git aliases, which give the possibilities easily to: add/update/remove the framework. You can add these shortcuts to your .gitconfig file (under the [alias] block).

Work with submodules (framework)

subst = "!f() { git submodule status --recursive;}; f"

suba = "!f() { git submodule add ; git submodule update --init --recursive;}; f"

subu = "!f() { git submodule sync; git submodule update;}; f"

subur = "!f() { git submodule sync; git submodule update --remote --merge --recursive --force;}; f"

suburc = "!f() { git submodule sync; git submodule update --remote --merge --recursive --force; git commit -m "Submodules updated";}; f"

subrm = "!f() { git submodule deinit -f ; git rm -f ; git commit -m 'Removed submodule'; rm -rf .git/modules/;}; f"

Optional

Branching

co = "!f() { git checkout ;}; f"

cou = "!f() { git checkout ; git subur;}; f"

con = "!f() { git checkout -b ; git track;}; f"

rbr = "!f() { git push origin :; git branch -D ;}; f"

br = "!f() { git branch;}; f"

Working with tags

ptag = "!f() { git push --tags;}; f"

ctag = "!f() { git tag -a -m "";}; f"

cptag = "!f() { git ctag ; git ptag;}; f"

rtag = "!f() { git fetch --prune origin '+refs/tags/:refs/tags/'; git push origin --delete ; git fetch --prune origin '+refs/tags/:refs/tags/';}; f"

Other

st = "!f() { git status;}; f"

pu = "!f() { git push origin HEAD;}; f"

addup = "!f() { git remote add upstream ; git remote -v;}; f"

updfork = "!f() { git fetch upstream; git checkout master; git merge upstream/master;}; f"

Home

Clone this wiki locally