Code Monkey home page Code Monkey logo

Comments (8)

janpecha avatar janpecha commented on July 20, 2024

Hi, thanks for report, this is strange.

Try execute commands manually in command line and check if they works.

If they works, dump current working directory and exit-codes. Insert var_dump before this line https://github.com/czproject/git-php/blob/master/src/GitRepository.php#L584:

var_dump(array($ret, getcwd(), $this->cwd, $this->repository));

And sent me the output here.

from git-php.

janpecha avatar janpecha commented on July 20, 2024

One additional question - what is your OS?

from git-php.

thamaraikrishnan avatar thamaraikrishnan commented on July 20, 2024

Hi Janpecha,

Output:

cmd : git commit -m "init commit"

var_dump:

    
        F:\latte\api_v2\core\vendor\czproject\git-php\src\GitRepository.php:586:
        array
        (size=4)
  0
        =>
        int
        128
  1
        =>
        string
        'F:\latte\devlibs\tmp\brewdemo'
        (length=29)
  2
        =>
        string
        'F:\latte\api_v2\core'
        (length=20)
  3
        =>
        string
        'F:\latte\devlibs\tmp\brewdemo'
        (length=29)
    

print_r:

Array
(
[0] => 128
[1] => F:\latte\devlibs\tmp\brewdemo
[2] => F:\latte\api_v2\core
[3] => F:\latte\devlibs\tmp\brewdemo
)

OS is Windows 10.

But, I have tried this in the linux box (Cent OS 6.7) where nothing is working for me. So, i don't know what went wrong. Then i moved to windows to verify this. I faced those issues (commit, add remote and push).

Thanks...

from git-php.

thamaraikrishnan avatar thamaraikrishnan commented on July 20, 2024

In linux box:
cmd : git commit -m 'init commit'

output:
array(4) {
[0]=>
int(127)
[1]=>
string(17) "/repo_manage/demo"
[2]=>
string(36) "/stagebrewservices/latte_v2/api/core"
[3]=>
string(17) "/repo_manage/demo"
}

Note: We have not installed the git server on both Windows and Linux server.

from git-php.

janpecha avatar janpecha commented on July 20, 2024

Yeah, you need install git client (see https://git-scm.com/download/linux) and it must be in system variable PATH. This PHP library is only wrapper over command line.

For Linux box exit-code 127 means "command not found".

from git-php.

thamaraikrishnan avatar thamaraikrishnan commented on July 20, 2024

Yes.. I installed git client on the linux box. Now it is working till commit process.

Push origin command is not working. Thanks a lot for your support.

But, I can execute the command by manually which asks to enter credentials also.

output:

git push origin

array(4) {
[0]=>
int(128)
[1]=>
string(22) "/repo_manage/sampleone"
[2]=>
string(36) "/stagebrewservices/latte_v2/api/core"
[3]=>
string(22) "/repo_manage/sampleone"
}

from git-php.

janpecha avatar janpecha commented on July 20, 2024

git push is a little bit problematic. Currently is not posiblle take user+password into $git->push() method. I will try find any solution for it, but it takes some time. You can temporarily:

  1. use SSH (+SSH key) instead of HTTPS with user+password
  2. save credentials to cache (see http://www.tilcode.com/push-github-without-entering-username-password-windows-git-bash/ or https://help.github.com/articles/caching-your-github-password-in-git/)
  3. insert password & user into remote (git add remote origin "https://user:password@server/path")

EDIT:

  1. for push() you can use --repo argument - https://stackoverflow.com/a/12193555
    • $git->push(NULL, array('--repo' => 'https://user:password@server/path/repo.git'));

from git-php.

thamaraikrishnan avatar thamaraikrishnan commented on July 20, 2024

Ok.. Thanks for your support...

from git-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.