In a fish function, can I run a command from a certain directory without changing into it?
Can I run a git command (
push) from outside the repository by specifying its path somehow?
I'd like to do something like this:
function backup set BKDIR /flash/drive rsync -av $HOME/important/ $BKDIR/important/ cd $HOME/git_repo git push flash master end
But I don't want to change into some other directory. It'd be great if I could sync the git repo like when I use rsync: by specifying the source directory but not changing the working directory.
I suppose a last resort would be to record the current directory at the beginning and change back to it at the end.