Closed trajano closed 5 months ago
@trajano what's the config like?
alias:
- name: ac
value: "!git add -A && git commit"
type: git
- name: fp
value: fetch --prune
type: git
- name: puf
value: "!git push --force --set-upstream origin $(git rev-parse --abbrev-ref HEAD)"
type: git
- name: lg
value: log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
type: git
- name: r
value: "!git fp && (GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash origin/HEAD || GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash origin/master)"
type: git
- name: dh
value: diff --name-status origin/HEAD
type: git
This is partial the full aliae config is pretty long
I think it's this one
value: "!git push --force --set-upstream origin $(git rev-parse --abbrev-ref HEAD)"
Somehow it's executing the value inside
It generates this
git config --global alias.puf "!git push --force --set-upstream origin $(git rev-parse --abbrev-ref HEAD)"
But ideally it should be (note single quotes)
git config --global alias.puf '!git push --force --set-upstream origin $(git rev-parse --abbrev-ref HEAD)'
Work around to use back ticks didn't work
value: "!git push --force --set-upstream origin `git rev-parse --abbrev-ref HEAD`"
This one worked
- name: puf
value: "!git push --force --set-upstream origin \\$(git rev-parse --abbrev-ref HEAD)"
type: git
which generates
git config --global alias.puf "!git push --force --set-upstream origin \$(git rev-parse --abbrev-ref HEAD)"
Code of Conduct
What happened?
Seems like it is checking for a git repo when git aliases are used.
What OS are you seeing the problem on?
Linux
Which shell are you using?
bash