Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Git Commit Command Fails (Exit Code 1) #74

Open
@dmerfeld

Description

My code structure looks something like this:

use CzProject\GitPhp\Git;
$git = new Git;
$repo = $git->open(base_path()); // base path of local files
$repo->checkout('main');
$repo->pull('origin');
// make some changes to the local files.
// check for changes made
if ($repo->hasChanges()) {
 $repo->addAllChanges();
 $repo->commit('My Commit Message');
 $repo->push(NULL, array('--repo' => 'https://'.env('GITHUB_USER').':'.env('GITHUB_PASS').'@github.com/MyUser/MyRepo.git'));
}

I am able to read the repo, make changes, detect those changes all with success. However when I try to do a commit, I get an error. Command 'git commit -m 'My Commit Message'' failed (exit-code 1).

I've tried setting up the repo to use https and SSH, both fail at the same step. All commands continue to work in the Terminal as expected. Any thoughts on why I would get a failure on the commit command?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /