Code Red > .NET

nice git alias

(1/1)

kdub_nz:
I don't use the command-line often, mostly use GitKraken and git from VS diectly

but came across this neat alias for the command-line
One time setup:

--- Code: ---$ git config --global alias.logline "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

--- End code ---
Then just use

--- Code: ---$ git logline

--- End code ---

JohnK:
That's a nice one.

I'm not sure this one will work in Windows--in Unix the command line will "pause" after so many lines and you can scroll up/down--but this one is a more spread out version that I like every now and again.

--- Code: ---git config --global alias.pretylog "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(red)%h%C(reset) %C(dim white):%C(reset) %C(green)(%ar)%C(reset) %C(red)~%C(reset) %C(dim white)%an%C(reset) %C(bold yellow)%d%C(reset) %n''   %C(white)%s%C(reset) %n ' --all"
--- End code ---


--- Code: ---git pretylog
--- End code ---

I also have a few of these types of entries in my gitconfig file for creating a quick branch.

--- Code: ---git config --global alias.stupid "branch testing | git checkout testing"

--- End code ---
That way when I get a dumb/stupid idea I can just use "git stupid" to create a quick branch to test something.

Navigation

[0] Message Index

Go to full version