Thursday, 15 September 2011

Trying to use fabric to check out a git repository to a subdirectory -



Trying to use fabric to check out a git repository to a subdirectory -

i'm using fabric automate branch creation. problem don't know branch name before function called, , fabric doesn't work cd.

how can tell git target directory going 1 level lower?

fabfile:

def new_branch(branch_name): local('mkdir ' + branch_name) local('git clone /var/www/finance ' + branch_name) local('git checkout head ./' + branch_name + ' -b ' + branch_name)

the output i'm getting is:

[localhost] local: mkdir test [localhost] local: git clone /var/www/finance test cloning 'test'... done. [localhost] local: git checkout head ./test -b test fatal: not git repository (or of parent directories): .git fatal error: local() encountered error (return code 128) while executing 'git checkout head ./test -b test' aborting.

one way utilize path parameters git. parameters verified git version 1.7.9.5.

local('git --git-dir ' + branch_name + '/.git --work-tree ' + branch_name + ' checkout head -b ' + branch_name)

git fabric

No comments:

Post a Comment