0

I have the following git aliases:

[alias]
        b           = branch
        p           = push
        co          = checkout
        cm          = commit -m
        cmall       = !git add -A && git commit -m
        cob         = checkout -b
        cached      = diff --cached
        addall      = add -A
        editconfig  = config --global -e
        save        = !git add -A && git commit -m SAVEPOINT
        unsave      = reset HEAD~1 --mixed
        amend       = commit -a --amend
        wipe        = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
        reset       = !git reset --hard HEAD && git clean -qfdx

reset should actually reset, but as is still leaves untracked files.

based on git reset --hard HEAD leaves untracked files behind, the second part of my reset should work, in fact it does when I do it alone...which makes me thing there's error in my gitconfig syntax. Why isn't reset working? Thank you

Community
  • 1
  • 1
codyc4321
  • 9,014
  • 22
  • 92
  • 165

2 Answers2

2

From the git-config man page: "To avoid confusion and troubles with script usage, aliases that hide existing git commands are ignored."

So your reset alias is being ignored and the original reset command is run. You'll have to name the alias something else.

T0xicCode
  • 4,583
  • 2
  • 37
  • 50
1

Or maybe there is a way! Mhwuahahaha

http://blogs.atlassian.com/2014/10/advanced-git-aliases/

my_alias = "!f() { 〈your complex command〉 }; f"

Paul Melero
  • 1,323
  • 15
  • 15