0

I have this alias for git setup which is working.

git config alias.migrations 'log'

But when I add a parameter its not working correctly.

git config alias.migrations 'log -- **/Migrations/'

Any ideas?

So when I do

git log -- **/Migrations/

I get all logs showing changes from Migrations folder.

But when I use the alias, I dot see any output, neither does it give any error.

git log alias

The image above also shows the config file inside of .git folder.

VivekDev
  • 20,868
  • 27
  • 132
  • 202

1 Answers1

0

Getting things working is a pain to my dumb brain.

Ok, so here is how I settled it, using a function. Reference.

git config alias.migrations '!fmigrations() { git log -- **/Migrations/; }; fmigrations'

A couple of more cents.

To list all of the aliases. Reference

git config --get-regexp alias

To remove an alias. Reference

git config --unset alias.migrations

Finally, you may want to add --global flag if you want that alias to be global. So the commands would be

git config --global alias.migrations '!fmigrations() { git log -- **/Migrations/; }; fmigrations'
git config --global --unset alias.migrations
VivekDev
  • 20,868
  • 27
  • 132
  • 202