git aliases

Hey, devs!

Here are a few of my git aliases — I like using git from the command line.

Feel free to try them and let me know if you’re interested in learning more about how and why I use them.

Even better, present us some of your own — I’d love to …


This content originally appeared on DEV Community and was authored by Rudi Farkas

Hey, devs!

Here are a few of my git aliases -- I like using git from the command line.

Feel free to try them and let me know if you're interested in learning more about how and why I use them.

Even better, present us some of your own -- I'd love to see them!

### git trb <commit> ### tag and rebase on commit
trb = "!f() { bra=$(git rev-parse --abbrev-ref HEAD);  git tag ${bra}-BAK;      git rebase ${1}; }; f"

### git trbi <commit> ### tag and rebase interactively on commit
trbi = "!f() { bra=$(git rev-parse --abbrev-ref HEAD); git tag -f ${bra}_BAK;   git rebase -i ${1}; }; f"

### git tsqn <n> ### tag and squash last n commits
tsqn = "!f(){ bra=$(git rev-parse --abbrev-ref HEAD);  git tag -f ${bra}_BAK;   git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%s --reverse HEAD..HEAD@{1})\"; }; f"

### git tsqc <commit> ### tag and squash on top of the commit
tsqc = "!f(){ bra=$(git rev-parse --abbrev-ref HEAD);  git tag -f ${bra}_BAK;   git reset --soft ${1} && git commit --edit -m\"$(git log --format=%s --reverse HEAD..HEAD@{1})\"; }; f"

@rudifa


This content originally appeared on DEV Community and was authored by Rudi Farkas


Print Share Comment Cite Upload Translate Updates
APA

Rudi Farkas | Sciencx (2024-10-17T20:07:33+00:00) git aliases. Retrieved from https://www.scien.cx/2024/10/17/git-aliases-3/

MLA
" » git aliases." Rudi Farkas | Sciencx - Thursday October 17, 2024, https://www.scien.cx/2024/10/17/git-aliases-3/
HARVARD
Rudi Farkas | Sciencx Thursday October 17, 2024 » git aliases., viewed ,<https://www.scien.cx/2024/10/17/git-aliases-3/>
VANCOUVER
Rudi Farkas | Sciencx - » git aliases. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/17/git-aliases-3/
CHICAGO
" » git aliases." Rudi Farkas | Sciencx - Accessed . https://www.scien.cx/2024/10/17/git-aliases-3/
IEEE
" » git aliases." Rudi Farkas | Sciencx [Online]. Available: https://www.scien.cx/2024/10/17/git-aliases-3/. [Accessed: ]
rf:citation
» git aliases | Rudi Farkas | Sciencx | https://www.scien.cx/2024/10/17/git-aliases-3/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.