Yes: you can git init, add and commit in the live environment, then you can create the relevant branches (still from the live environment where your repo resides):
git checkout -b dev
git --work-tree=/path/to/dev add .
git commit -m "dev"
git checkout master
git checkout -b test
git --work-tree=/path/to/tes add .
git commit -m "test"
From there, it is best to clone (git clone --mirror
) that repo elsewhere, as a bare repo, and manage the update of your live, test and dev environments through post-receive hook.