Code Monkey home page Code Monkey logo

git-php's Introduction

Git-PHP

Build Status Downloads this Month Latest Stable Version License

Library for work with Git repository in PHP.

Donate

Installation

Download a latest package or use Composer:

composer require czproject/git-php

Library requires PHP 5.6 or later and git client (path to Git must be in system variable PATH).

Git installers:

Usage

$git = new CzProject\GitPhp\Git;
// create repo object
$repo = $git->open('/path/to/repo');

// create a new file in repo
$filename = $repo->getRepositoryPath() . '/readme.txt';
file_put_contents($filename, "Lorem ipsum
	dolor
	sit amet
");

// commit
$repo->addFile($filename);
$repo->commit('init commit');

Initialization of empty repository

$repo = $git->init('/path/to/repo-directory');

With parameters:

$repo = $git->init('/path/to/repo-directory', [
	'--bare', // creates bare repo
]);

Cloning of repository

// Cloning of repository into subdirectory 'git-php' in current working directory
$repo = $git->cloneRepository('https://github.com/czproject/git-php.git');

// Cloning of repository into own directory
$repo = $git->cloneRepository('https://github.com/czproject/git-php.git', '/path/to/my/subdir');

Basic operations

$repo->hasChanges();    // returns boolean
$repo->commit('commit message');
$repo->merge('branch-name');
$repo->checkout('master');

$repo->getRepositoryPath();

// adds files into commit
$repo->addFile('file.txt');
$repo->addFile('file1.txt', 'file2.txt');
$repo->addFile(['file3.txt', 'file4.txt']);

// renames files in repository
$repo->renameFile('old.txt', 'new.txt');
$repo->renameFile([
    'old1.txt' => 'new1.txt',
    'old2.txt' => 'new2.txt',
]);

// removes files from repository
$repo->removeFile('file.txt');
$repo->removeFile('file1.txt', 'file2.txt');
$repo->removeFile(['file3.txt', 'file4.txt']);

// adds all changes in repository
$repo->addAllChanges();

Branches

// gets list of all repository branches (remotes & locals)
$repo->getBranches();

// gets list of all local branches
$repo->getLocalBranches();

// gets name of current branch
$repo->getCurrentBranchName();

// creates new branch
$repo->createBranch('new-branch');

// creates new branch and checkout
$repo->createBranch('patch-1', TRUE);

// removes branch
$repo->removeBranch('branch-name');

Tags

// gets list of all tags in repository
$repo->getTags();

// creates new tag
$repo->createTag('v1.0.0');
$repo->createTag('v1.0.0', $options);
$repo->createTag('v1.0.0', [
	'-m' => 'message',
]);

// renames tag
$repo->renameTag('old-tag-name', 'new-tag-name');

// removes tag
$repo->removeTag('tag-name');

History

// returns last commit ID on current branch
$commitId = $repo->getLastCommitId();
$commitId->getId(); // or (string) $commitId

// returns commit data
$commit = $repo->getCommit('734713bc047d87bf7eac9674765ae793478c50d3');
$commit->getId(); // instance of CommitId
$commit->getSubject();
$commit->getBody();
$commit->getAuthorName();
$commit->getAuthorEmail();
$commit->getAuthorDate();
$commit->getCommitterName();
$commit->getCommitterEmail();
$commit->getCommitterDate();
$commit->getDate();

// returns commit data of last commit on current branch
$commit = $repo->getLastCommit();

Remotes

// pulls changes from remote
$repo->pull('remote-name', ['--options']);
$repo->pull('origin');

// pushs changes to remote
$repo->push('remote-name', ['--options']);
$repo->push('origin');
$repo->push(['origin', 'master'], ['-u']);

// fetchs changes from remote
$repo->fetch('remote-name', ['--options']);
$repo->fetch('origin');
$repo->fetch(['origin', 'master']);

// adds remote repository
$repo->addRemote('remote-name', 'repository-url', ['--options']);
$repo->addRemote('origin', '[email protected]:czproject/git-php.git');

// renames remote
$repo->renameRemote('old-remote-name', 'new-remote-name');
$repo->renameRemote('origin', 'upstream');

// removes remote
$repo->removeRemote('remote-name');
$repo->removeRemote('origin');

// changes remote URL
$repo->setRemoteUrl('remote-name', 'new-repository-url');
$repo->setRemoteUrl('upstream', 'https://github.com/czproject/git-php.git');

Troubleshooting - How to provide username and password for commands

  1. use SSH instead of HTTPS - https://stackoverflow.com/a/8588786
  2. store credentials to Git Credential Storage
  3. insert user and password into remote URL - https://stackoverflow.com/a/16381160
    • git remote add origin https://user:password@server/path/repo.git
  4. for push() you can use --repo argument - https://stackoverflow.com/a/12193555
    • $git->push(NULL, ['--repo' => 'https://user:password@server/path/repo.git']);

Other commands

For running other commands you can use execute method:

$output = $repo->execute('command');
$output = $repo->execute('command', 'with', 'parameters');

// example:
$repo->execute('remote', 'set-branches', $originName, $branches);

Custom methods

You can create custom methods. For example:

class OwnGit extends \CzProject\GitPhp\Git
{
	public function open($directory)
	{
		return new OwnGitRepository($directory, $this->runner);
	}
}

class OwnGitRepository extends \CzProject\GitPhp\GitRepository
{
	public function setRemoteBranches($name, array $branches)
	{
		$this->run('remote', 'set-branches', $name, $branches);
		return $this;
	}
}


$git = new OwnGit;
$repo = $git->open('/path/to/repo');
$repo->addRemote('origin', 'repository-url');
$repo->setRemoteBranches('origin', [
	'branch-1',
	'branch-2',
]);

License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/

git-php's People

Contributors

asenar avatar bert-oja avatar bird87za avatar c33s avatar gerryd avatar janpecha avatar johanfredrikvaren avatar justin991q avatar kawax avatar kernel23 avatar mawalu avatar ribeiropaulor avatar sudo-plz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-php's Issues

Git command failed (exit-code 129) unknown option: 'end-of-option'

I use git-php in Lumen framework with the following code

  try{
        $git = new Git();
        $remote = env('GIT_URL').$request->code;

        $local = storage_path('repo')."/".$request->code;
        $repo = $git->open($local);
        $repo->execute("config", "user.name", "latexbki");
        $repo->execute("config", "user.email", "[email protected]");

        $filename = $repo->getRepositoryPath() . '/'.$request->file;
        file_put_contents($filename, $request->content);
        
        $repo->addFile($filename);
        $repo->commit("test adding notes", "--author=latexbki <[email protected]>");
        $repo->push(NULL, ['--repo'=>$remote]);

        return response()->json(['status'=>"success", 'message'=>"Changes pushed to remote successfully"], 200);
    }catch(\Exception $e)
    {
        $errormessage = "Draft Controller: ".$e->getMessage()." -- in line ".$e->getLine();
        return response()->json(['code'=>500, 'status'=>"error", 'message'=>$errormessage], 500);
    }

When I run the code, I get the error
Command 'git push --repo 'https://latex.bki%40gmail.com:[email protected]/62c7951c097b4c6fdf2980b4' --end-of-options' failed (exit-code 129). error: unknown option end-of-options

I previously get the same error from addFile and I resolve it by commenting the end-of-option part.

My questions are:

  1. Is it okay if I commented the end-of-option part? The code run just fine with the option commented out
  2. Is it maybe related to the git version? For information, I am using a rather old server with git version 2.7.4

Thank you very much

Looks like addFile cannot handle umlauts

The method "addFile" seems to remove any URL-encoded umlauts (e.g. äöü) in the filename...?

Here is a snippet of the code that works just fine with any filename that has no umlaut in it:

# the variable $gitfilename contains the string "/tmp/Test,Test G\xc3\xbcnther__test.txt" wich is the encoded form of "/tmp/Test,Test Günther__test.txt"

$val = file_put_contents($gitfilename, $txt, FILE_APPEND);
echo('Successfully written ' . $val . ' bytes to file ' . $gitfilename);
# Output: Successfully written 534 bytes to file /tmp/Test,Test G\xc3\xbcnther__test.txt

# Note that the file is now correctly listed in the file system:
# ls -al
# -rw-rw----  1 user group  534 Jan 29 09:09 'Test,Test Günther__test.txt'

$repo->addFile($gitfilename); 
# git exception: Command 'git add --end-of-options '/tmp/Test,Test Gnther__test.txt'' failed (exit-code 128)

How to log the output of the Git commands?

Is there a way to log the output of the Git commands?

I didn't find any function right away that expected a LoggerInterface as a parameter, for example.

I noticed that the outputs from StdOut and StdErr are captured in the RunnerResult object. That would actually be exactly what I need.
But unfortunately only the run() method returns the RunnerResult object, not the commit() and push() methods.
So when I commit, I no longer have a way to access the RunnerResult.
How do I continue here?

Setting and pushing to new remote

Hello!

I've been trying to use your library to push to a new repository created via GitHub API on my app.

I've been able to make everything work so far, but I am having trouble with the git remote add and git push bits of my flow.

Imagine I wanted to do exactly as GitHub suggests when setting a new remote and pushing to it:

git remote add origin [email protected]:organization/repository.git

and then

git push -u origin master

How would I achieve this?

Here's what I've been trying:

  $new_repository->addRemote('origin', '[email protected]:organization/repository.git');

  $new_repository->push('origin', ['--set-upstream']);

But this keeps failing with this being logged:

Cz\Git\GitException: Command 'git push origin '--set-upstream'' failed (exit-code 128). in Cz\Git\GitRepository->run() (line 584 of /vagrant/www/vendor/czproject/git-php/src/GitRepository.php).

Can you provide any insight?

How do I get Output?

Do I have to do anything special to see the output of the commands I run. I don't see any output unless there was a fatal exception. Once I got everything worked any output stopped. The only way I know something worked is by checking the files.

Here is my code:


<?php
require __DIR__ . '/vendor/autoload.php';
// create repo object
$repo = new Cz\Git\GitRepository('/home/test_repo/public_html');

$repo->pull('origin');

$repo->checkout('first-draft');

--end-of-options is not supported on git 2.35.1 and 2.25.1

In Commit 5e82d54 you have added the option --end-of-options to every command.
In theory this should just work and also the documentation 2.35.1 and 2.25.1 mention this option.

But on both versions specifically the latest for ubuntu 20.04 and 2.35.1 as it's used on Ubuntu 20.04 in github actions always fail for me with the --end-of-options option enabled.

user@machine:~/testrepo$ git checkout --end-of-options test
error: pathspec '--end-of-options' did not match any file(s) known to git
error: pathspec 'test' did not match any file(s) known to git

user@machine:~/testrepo$ git checkout test
Switched to branch 'test'

user@machine:~/testrepo$ git --version
git version 2.25.1

The above is from my server running ubuntu 20.04 with latest version of git, the exact same behaviour happens in github actions for me.

Edit: fixed wrong link

Cloning particular branch

Looks like there is no option to clone particular branch.

Is there any plan to add that or should i send a pull request?

sample of Clone

Hi ,
I need clone repository from http on client PC , have a sample Code with git-php . Client send a request for clone and php script response it.

like a
'git clone http://web/myscript/repo.git'
'git pull and push ...'

Is this library production ready?

Hi, this library sounds great for me since i wanna try about managing git repository in php. But i saw there are lots of PR waiting to be merge or issue waiting to be solve..so i wonder is this library ready to use in production environment?

Thanks.

git remote

I see you have a method for getRemoteBranches which does git branch -r behind the scenes, but why not also have a method getRemotes which would do git remote behind the scenes? It could even take -v argument optionally...

https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes

    public function getRemotes(bool $displayUrls = false)
    {
        $command = $displayUrls ? 'git remote -v' : 'git remote';
        return $this->extractFromCommand($command, function($value) {
            return trim(substr($value, 1));
        });
    }

getLastCommitId fails

As the CommandProcessor is putting sinqle quotes around the argument that has double quotes (--pretty=fomat:"%H") to "git log", executed by GitRepository::getLastCommitId, the commit ID is then output with surrounding double quotes

This causes CommitId to throw "Invalid commit ID"

CommandProcessor generates this command,
git log '--pretty=format:"%H"' -n 1
which when executed returns
"8d14d508186179480bc35a5c0ab6d9a0f6db863b"

Had it instead been
git log --pretty=format:"%H" -n 1
or
git log '--pretty=format:%H' -n 1
it would work:
8d14d508186179480bc35a5c0ab6d9a0f6db863b

Return type annotations erroneously specify self

All methods in the Cz\Git\GitRepository class that return either $this or static annotate self as their return type. This may cause IDEs (e.g. PhpStorm) to warn about type incompatibility between Cz\Git\GitRepository and extensions of that class.

Given the following extension of \Cz\Git\GitRepository:

<?php
namespace App\Git;

class GitRepository extends \Cz\Git\GitRepository {

	/**
	 * Indicates whether or not there are any unstaged changes at a file/path.
	 *
	 * @param string $path
	 * @return bool
	 */
	public function hasPathChanges(string $path): bool {
		$this->begin();
		$resultCode = null;
		$output = [];
		exec("git diff --exit-code '$path'", $output, $resultCode);
		$this->end();
		return $resultCode == 1;
	}

}

And given the following use of that extension:

<?php
namespace App;

use App\Git\GitRepository;

class VersionControl {

	private ?GitRepository $clonedRepo = null;

	public function doNeatStuff(Project $project): bool {
		# Doing some neat stuff here
		GitRepository::cloneRepository($project->getPath(), $this->getClonePath($project))
		# ... and some more neatness
	}

}

This will cause PhpStorm to raise the following alert for the method call made in VersionControl::doNeatStuff():

Incompatible types: Expected property of type '\App\Git\GitRepository|null', '\Cz\Git\GitRepository' provided

This is contrary to the reality of the matter, as \Cz\Git\GitRepository::cloneRepository() does not explicitly instantiate \Cz\Git\GitRepository objects, but rather static objects.

Similarly, non-static methods claim to return self instances, when they should rather claim to return Cz\Git\IGit type objects.

Issue with big repos and branch listings

Hi there:

I'm trying to list all the branches from a big repository (arround 520 branches) but the command never ends.

$repo = $git->open(..path..); $branches = $repo->getBranches();
When there is only one remote, the command works fine.
When using 2 remotes, the command never ends (waited for more than 30 minutes).

I even tried to configure pager.branch => false or cat to avoid less output, but without luck.

Using PHP 7.4

Git commit fails some times

Hi, we used to commit from our local system to git repository. overall its working fine.
but, some time I am getting following error,

Cz\Git\GitException: Command 'git commit '1779e4620f28568d37bc6d218359d99f/ed6879fe3ab14763885e8f1c41b2e22b' -m 'Commit : 489b024e153b433394fd83add47be80d_enterprise_1.0.0'' failed (exit-code 128). in [my application path]

it is working fine when i commit following command manually (through putty),
git commit '1779e4620f28568d37bc6d218359d99f/ed6879fe3ab14763885e8f1c41b2e22b' -m 'Commit : 489b024e153b433394fd83add47be80d_enterprise_1.0.0''

  • but through application it is not working when i am having new file in that folder.

When I check status in that directory it will be like in attachement
git_error

I don't know what is the problem.
Thanks in advance!!

Restore previous working directory after throwing a GitException

I noticed that you change the working directory in your class.
After a successfull action you call your end() method to restore the previous working directory.
But if you throw a GitException if something goes wrong, end() isn't called.

So applications which uses this lib have a wrong cwd after a GitException happend.
I had to manually chdir to my applications main dir.

Can't install this package

Hello
After run composer require czproject/git-php
I can't run composer install
because there is nothing to install or update.
Anyone can help me? Thank you!

Github connection tester does not work through http

Hello,

I have a private repository in Github: 7system7/test. I would test my connection w/ this code:

use CzProject\GitPhp\Git;

$git = new Git();
$git->isRemoteUrlReadable('https://<username>:<token>@github.com/7system7/test.git'); // false

It always returns false, however the token has permission for everything. What have I wrong?
If I test it the same way in Gitlab or Gitea, it works.

git commit, addRemote and push failed

Hi,
I am new to git process. I have tried to use all functions which are all working fine except commit, addRemote and push commands. I guess, the problem is due to user credentials. Please guide me to set user credentials using this git-php lib. Please help me to move forward for fixing these issues if it is not related to user credentials.

Errors:
git commit Error : "Command 'git commit -m "init commit"' failed."
git add remote Error : "Command 'git remote add "origin" "https://user:[email protected]/user/demo.git\"' failed."

Thanks in advance...

Getting command returns

Is there any way i can get the response which i use to get while executing the command in console?

I am building a cli app for our project and the cli app clones a repo. I want to show the status to the user about the on going process. is there any way i can get that?

confusion about path to repo option !!!

we can see in code,'path/to/repo'.

// create repo object
$repo = new Cz\Git\GitRepository('/path/to/repo');

I just wanted to know, what is this path? here is my folder structure

dockerproject
|----.git
|----app
           |----index.php
           |----comspoer.json
           |----vendor
|----docker.compose.yml

How to add all files after initializing a new repo?

I wanted to clone a repo and create new repo out of it with some minor modifications

Unfortunately there is no method to add all files in one shot for my initial commit. Is there any way i can do that?

Consistency between executing commands

Hi,

I'm having three questions related to consistent command execution. I will post them in this same issue, but in different comments.

1. GitRepository::run() vs. exec()

I'd like to ask about the different styles of executing git commands in this library. Some methods of GitRepository use GitRepository::run() to execute commands, while others use the exec() function directly. Am I correct that this is just because different developers were not familiar with how to execute commands in a consistent way (run())? If so, can I make a PR that changes all commands to be run via run()?

Methods that use run():

  • createTag()
  • removeTag()
  • renameTag()
  • merge()
  • createBranch()
  • removeBranch()
  • checkout()
  • removeFile()
  • addFile()
  • addAllChanges()
  • renameFile()
  • commit()
  • hasChanges()
  • pull()
  • push()
  • fetch()
  • addRemote()
  • renameRemote()
  • removeRemote()
  • setRemoteUrl()

Methods that use exec() directly:

  • getLastCommitId()
  • getCommitMessage()
  • getCommitData()

Well, actually now that I created this list of methods, I noticed that there's only three methods calling exec() directly, but then again I still think that it would be cleaner to refactor them to use run() instead.

Class 'GitRepository' not found

I am working on laravel framework. I installed this through composer.
$repo = GitRepository::init('/path/to/repo-directory', array(
'--bare', // creates bare repo
));
In this line I get error
"Class 'GitRepository' not found"

How to get an array of changed files?

There is the method hasChanges() which returns true, if there are any changed files.
But I don't see a method which returns what files have been changed.
Am I overlooking something?

escapeshellarg not working on Windows

I have an issue with this line:

$cmd[] = escapeshellarg($arg);

... on Windows. As described here:
https://www.php.net/manual/en/function.escapeshellarg.php#123718

I now solved it by creating a new class extending GitRepository, overwriting the execute and processcommand methods, where I rewrite the escape lines.

if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
                        $cmd[] = $_c . self::escape_win32_argv($value);
                    } else {
                        $cmd[] = $_c . escapeshellarg($value);
                    }

where the escape_win32_argv() function is from the above mentioned topic at the PHP site.

chekout branch not working

I have a custom method and when I try to checkout in a different branch nothing exists in the project folder

At the end I solve it with exec('git checkout <branch>')

Method to check if repo exists without cloning.

i wanted a way to check if the repo exists in the git url

Use case:

  1. Clones base project (kinda big project)
  2. Setting up the base project
  3. Clones child repo

I dont want to come to third step and fail if repo is not found and do a clean up. Child repo has multiple implementations and the name of child repo is given by the user (chances of typo)

I was thinking if there is any way to verify that the repo is existing and my cli app can read its info (which proves me that the user has valid ssh key).

Basically i wanted to start cloning/downloading the repos after verifying that all the repos are existing and accessible.

I came across this question.

git log / git diff / searching

Hi,

i try to implement some missing features e.g. git log

i use as start

		public function getBranches()
		{
			return $this->extractFromCommand('git branch -a', function($value) {
				return trim(substr($value, 1));
			});
		}

i modified that function in my own class like this:

class OwnGitRepository extends \Cz\Git\GitRepository
{
        public function getLog($options="")
        {
                return $this->extractFromCommand("git log $options", function($$
                                return trim(substr($value, 0));
                        });
        }
}

but when i print this, i only get last commit as array...sorry, i fetched with --depth=1 so there is only commit, also on command line

can you help me getting log,diff and searches (git log --regex/-G) working?

Git Commit Command Fails (Exit Code 1)

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?

hasChanges depends on user language

I noticed that hasChanges compares the shell output in order to determine if there are changes

return (strpos($lastLine, 'nothing to commit')) === FALSE;

Some users have other locales installed:

git status                                                                                                                                                                    [master] 
Auf Branch master
Ihr Branch ist auf dem selben Stand wie 'origin/master'.

nichts zu committen, Arbeitsverzeichnis unverändert

nichts zu committen is the German translation of nothing to commit which is not beeing detected correctly.

I had a look at the code and did not find a similar string comparison, changing

$lastLine = exec('git status');
// to
$lastLine = exec('LANG=en git status');

works for me, I'm not sure if this works on windows. If you'd like I could open a PR for this - if there are other places where shell output is compared I would like to fix those as well if you could point me there. Updating processCommand would probably work in most cases if there are any.

My workaround for now is to run my application with LANG=en.

Version 4.0

$git = new CzProject\GitPhp\Git;
$repo = $git->init(__DIR__ . '/directory');
$repo->commit('message');

$repo2 = $git->open(__DIR__ . '/repo2'); // or new GitRepository(__DIR__ . '/repo2')
$repo->run('remote set-branches', 'origin', 'branch-1');

  • remove IGit interface
  • add new factory class Git with methods:
    • open($directory): GitRepository
    • init($directory, $params): GitRepository (replacement for GitRepository::init())
    • clone($url, $directory): GitRepository (replacement for GitRepository::cloneRepository())
    • isRemoteUrlReadable($url, $refs): bool (replacement for GitRepository::isRemoteUrlReadable())

GitRepository

  • make run() public
  • remove begin() & end()
  • remove static methods init, cloneRepository, isRemoteUrlReadable
  • move static methods extractRepositoryNameFromUrl & isAbsolute to new class Helpers

Internals

  • maybe use https://github.com/czproject/runner
  • introduce new interface IGitRunner
    • new class CliRunner (default)
    • new class MemoryRunner (for tests)
  • change @return self to @return static in PhpDocs
  • use proc_open instead of exec (#33)
  • updated tests
  • use $var name in PhpDocs
  • use PHPStan
  • support for PHP 8.x
  • GitHub Actions

Fork and pull request

Hello,
Is it possible to use your package for fork and make pull requests ?
I did not find an example in the readme.

Set Email Pushing?

How can I set the email and name of the person pushing to a git repo?

Add all failed

Hey,

i get on $repo->addAllChanges(); "Command 'git add --all ' failed (exit-code 128)"

How i can fix it?

Git log getter

I'm using git-php to generate a changelog for our application. To render the git log, I'm currently parsing the output of $repo->execute('log'), splitting each line and parsing depending on the first word (commit, author, date, none, etc).
I think it'd be nice if git-php supported something along these lines, maybe providing an array or a GitLogEntry object or similar.

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.