I have some aliases like:
add-and-commit = !git add -A && git commit -m
last = !git --no-pager log -1 --oneline
stash-and-reset = !git stash && git reset --hard HEAD
I track my dotfiles with a bare repo.
d = !git --git-dir=/media/blueray/WDPurple/_DataBackup/_Work/_DailyBackups/dotfilesBackup --work-tree=$HOME
Now the problem is that, i can use:
git add-and-commit
git last
git stash-and-reset
But I can not do:
git d add-and-commit
git d last
git d stash-and-reset
Is there any solution for that?
The following works for me:
The
dot
command also works in combination withlast
andstash-and-reset
.P.S. I didn't set
--work-tree=$HOME
because I would get too many files, but it would work.Another way to solve your problem is to create a
bash alias
to track your dotfiles, this can also be used in combination with other git commands and aliases. See for instance this article!