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

[Question] How do you add non-hash parrameters? #97

Closed
xsawyerx opened this issue Feb 1, 2018 · 2 comments
Closed

[Question] How do you add non-hash parrameters? #97

xsawyerx opened this issue Feb 1, 2018 · 2 comments

Comments

@xsawyerx
Copy link

xsawyerx commented Feb 1, 2018

I couldn't find this in the documentation, sorry.

How do I run something like this:

git pull --rebase=preserve origin master

In this case, I can handle the rebase=preserve because it's key/value, but the other two parameters, which I tend to use when wanting to pull data from only one ref, I have no idea how to write.

@genehack
Copy link
Owner

genehack commented Feb 1, 2018

This should do what you want:

use Git::Wrapper
my $gw = Git::Wrapper->new('path/to/repo');
$gw->pull({ rebase => 'preserve' }, 'origin', 'master' ); 

Note that if you flip $Git::Wrapper::DEBUG to 1 it will print out each command that it is going to run. Example from REPL:

1> use Git::Wrapper;
2> my $gw = Git::Wrapper->new('./');
$res[0] = bless( {
         'dir' => './'
       }, 'Git::Wrapper' )
3> $Git::Wrapper::DEBUG = 1;
$res[1] = 1
4> $gw->pull({ rebase => 'preserve' }, 'origin', 'master' );
git pull --rebase=preserve origin master
status: 0
$res[2] = [
  'Already up to date.',
' 'Rebasing (1/1)
]

@xsawyerx
Copy link
Author

xsawyerx commented Feb 2, 2018

Cool, thanks!

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

No branches or pull requests

2 participants