This is note an issue, but but a proposal to improve the git() function defined in the optional usage 1.
This function requires to be at the same level of .git directory.
With this update, you could run it in every sub folder :
function git () {
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/.git" ]]; do
path=${path%/*}
done
if [ -d "$path" ]; then
docker run -ti --rm -v ${HOME}:/root -v ${path}:/git alpine/git "$@"
else
echo "Error: no .git directory found in parents"
fi
}
Hello,
This is note an issue, but but a proposal to improve the git() function defined in the optional usage 1. This function requires to be at the same level of .git directory.
With this update, you could run it in every sub folder :