From: gregor herrmann Date: Tue, 27 Sep 2011 16:25:53 +0000 (+0200) Subject: Set GIT_WORK_TREE relative to repository. X-Git-Url: https://git.toastfreeware.priv.at/gregoa/movein.git/commitdiff_plain/20b56b0862351799a71a89e2bfcef1a2498febd1?hp=7b5c38422916f7375dbb3c4a4a411d78338cd7d7 Set GIT_WORK_TREE relative to repository. $PWD only works when called in ~/. --- diff --git a/movein b/movein index 7746641..ea98b73 100755 --- a/movein +++ b/movein @@ -155,7 +155,7 @@ add() { git config core.bare false git config core.worktree ../../ git config status.showUntrackedFiles no - GIT_WORK_TREE="$PWD" git pull + GIT_WORK_TREE="$LOCAL_REPO/../../" git pull trap - 0 mr -c "$MRCONFIG" config "$LOCAL_REPO" checkout="git_fake_bare_checkout '$REPO_URL' 'REPO_NAME' '../../'" @@ -198,7 +198,7 @@ new() { git config core.bare false git config core.worktree ../../ git config status.showUntrackedFiles no - export GIT_WORK_TREE="$PWD" + export GIT_WORK_TREE="$LOCAL_REPO/../../" git add "$@" git commit -m "initial checkin" git push --all