Comments (8)
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.
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.
$repo->run("add $file_to_add");
should be $repo->run("add {$file_to_add}");
. See if that helps.
from git.php.
nothing is working. every time all things are being added.
from git.php.
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.
Hi,
thanks it worked. thanks for reply :)
from git.php.
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.
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)
- error HOT 2
- Array to string conversion HOT 1
- Concurrent handle ?
- How do I set up a sshkey Like this
- Bypass of PHP issue
- Fatal error: Uncaught exception 'Exception' with message 'error: unable to unlink
- On commit not finding use.name nor user.email HOT 2
- 0
- Add this library to Packagist please. HOT 2
- empty Exception thrown HOT 3
- Library doesn't work on FreeBSD HOT 10
- Push where upstream branch does not exist
- Host key verification failure HOT 1
- Line 333 throws error on "config --get alias.example"
- PHP hanging indefinitely due to stream_get_contents HOT 2
- fetch error
- Git Pull/Push error HOT 1
- Thrown ConsoleException when git command returns nothing HOT 1
- Composer 2.0 package-name // Uppercase name will error
- Update library in Packagist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git.php.