Coder Social home page Coder Social logo

Comments (8)

kbjr avatar kbjr commented on June 14, 2024

Can't confirm this at the moment as I'm out, but the commit method adds the -av flags automatically, which would add all files. Try using ->run('commit ...')

from git.php.

zeel avatar zeel commented on June 14, 2024

hi,
$repo = Git::open($path_to_repository);
$repo->run("commit $file_to_add");

it hangs

i tried this

$repo = Git::open($path_to_repository);
$repo->run("add $file_to_add");
$repo->commit($msg);

it added all the files.

can you specify what to do specifically?

from git.php.

mAAdhaTTah avatar mAAdhaTTah commented on June 14, 2024

$repo->run("add $file_to_add"); should be $repo->run("add {$file_to_add}");. See if that helps.

from git.php.

zeel avatar zeel commented on June 14, 2024

nothing is working. every time all things are being added.

from git.php.

kbjr avatar kbjr commented on June 14, 2024

Okay, let's first determine that the problem is with the library. Run this:

// First, let's be sure what this is
var_dump($file_to_add);

// Make sure that the files aren't already added before we even start
echo $repo->status();

// This should add only the given file
$repo->run('add '.$file_to_add);

// And actually commit the changeset
$repo->run('commit -m "your message"');

from git.php.

zeel avatar zeel commented on June 14, 2024

Hi,
thanks it worked. thanks for reply :)

from git.php.

kbjr avatar kbjr commented on June 14, 2024

It was probably the commit call, like I thought. You can do it this way for now, but I'm going to add an option to the commit method to avoid this in the future.

from git.php.

kbjr avatar kbjr commented on June 14, 2024

Okay, if you use the latest version @ 49aff09 you can pass in a second parameter to commit to avoid the add all flag:

$repo->add($file_to_add);
$repo->commit('commit message here', false);

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.