Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for --git-dir #1

Closed
rande opened this issue Sep 7, 2012 · 2 comments
Closed

support for --git-dir #1

rande opened this issue Sep 7, 2012 · 2 comments

Comments

@rande
Copy link

rande commented Sep 7, 2012

Hello,

It will be great to support the --git-dir feature. : http://stackoverflow.com/questions/672655/relocating-the-git-folder

It is like adding into the Repository class a getGitDir() which return . by default and use it everywhere the script runs a git command.

@alexandresalome
Copy link
Member

Sounds great, but before doing this, I would like to refactor the way processes are executed: using Symfony Process component.

Also, shell calls should be moved to the repository object, to factor calls and add such global arguments.

@alexandresalome
Copy link
Member

Hey @rande, great news for you: it's now possible to use git-dir option and also work-tree (for the working directory).

You need to pass it to the constructor:

$repo = new Repository("/path/to/.git", "/path/to/working-tree");
$repo->getWorkingCopy()->checkout("master");

You can also run any command using run method on Repository.

It's now part of master on gitlib.

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants