matteosister / GitElephant

An abstraction layer for git written in PHP
GNU Lesser General Public License v3.0
613 stars 74 forks source link

Problems with Stash and Pop #153

Closed AndreFabris closed 4 years ago

AndreFabris commented 5 years ago

There are no instructions how to use Stash and Pop. This all works as far as I can tell $repo = Repository::open($installpath . $folder); $repo->addGlobalConfig('user.email', 'abcd@abcd.com'); $repo->addGlobalConfig('user.name', 'John'); $repo->stashCreate(); $repo->stash(''); $repo->pull($git);

However now I want to pop the stashed changes. I need to pass the string $stash which I have no idea how to get. Whatever string I try to define or get from stashCreate I get something like: stash pop 'stash@{install}'" with reason: stash@{install} is not a valid reference

Any ideas how to perform stash pop?

GenieTim commented 5 years ago

You can call the stashPop() method on the $repo. See code for arguments.

AndreFabris commented 5 years ago

Yeah I know, I tried. The argument is string $stash which I have no idea what to pass. Tried a few things none worked.

GenieTim commented 5 years ago

I do not know what you tried, but as far as I know you need to pass the name of the stash which you can get e.g. from $repo->stashList()

AndreFabris commented 5 years ago

Ok cheers, I will try to see can I get that name from the stashList()

GenieTim commented 5 years ago

Were you able to achive your objective? If so, is it ok if I close this issue? Also, I would love to accept a PR if you want to improve the documentation.

imunhatep commented 4 years ago

No follow up received from the ticket author, I'm closing this.