Features
Implemented
-
Command generator and executor
- Generates command sequence
var git = Git(); print(git.log.prettyOpt(PF.oneline)); // 'git log --pretty=oneline' print(git.log); // 'git log'- Executes command sequence
var git = Git(); // Executes 'git log --pretty=tformat:commit hash = %H' and returns stdout git.log.prettyOpt('commit hash = ${PP.commitHash}').exec(); git.log.exec(); // Executes 'git log' -
Git commands support
-
Log - command
- Pretty - option
// you can use pretty option with two formatting choices: // 1. Basic formatter in PF enum such email, oneline and etc. // 2. Custom formatter which use tformat and placeholders in PP. var git = Git(); git.log.prettyOpt(PF.oneline).exec(); // 'git log --pretty=oneline' // 'git log --pretty=tformat:commit %H' print(git.log.prettyOpt('commit ${PP.commitHash}')); -
Push - command
- Options
var git = Git(); git.push.allOpt().exec(); // Runs 'git push --all' // Runs 'git push --force --all --dry-run' git.push.forceOpt().allOpt().dryRunOpt().exec(); // Runs 'git push --set-upstream origin master' git.push.setUpstreamOpt(remote: 'origin', refspec: 'master').exec();to- method
var git = Git(); // Runs 'git push origin master' git.push.to(remote: 'origin', refspec: 'master').exec(); // Runs 'git push --dry-run origin master' git.push.dryRunOpt().to(remote: 'origin', refspec: 'master').exec();
-
You can see feature implementation todo in repository projects
License
Distributed under the BSD-3-Clause License. See LICENSE for more information.
Libraries
- git_assistant
- Contains main classes and main functionalities.