sweetchuck/git
Composer 安装命令:
composer require sweetchuck/git
包简介
Git related helpers classes.
关键字:
README 文档
README
Commands
Why use this package instead of \exec()?
Using these commands instead of directly calling \exec() offers several advantages:
- Structured data handling
Results are parsed into PHP arrays and objects, making them easier to work with than raw command output.
Supported commands
- start a working area
- ✔
git init - ✔
git clone
- ✔
- work on the current change
- ✔
git add - ✔
git mv - ✔
git restore - ✔
git rm - 🛠
git apply -- <paths> - 🛠
git apply --stat - 🛠
git apply --numstat - 🛠
git apply --sumary - 🛠
git apply --check - 🛠
git stash- 🛠
git stash list - 🛠
git stash show - 🛠
git stash drop - 🛠
git stash pop - 🛠
git stash apply - 🛠
git stash branch - 🛠
git stash push - 🛠
git stash save - 🛠
git stash clear - 🛠
git stash create - 🛠
git stash store - 🛠
git stash export - 🛠
git stash import
- 🛠
- ✔
- examine the history and state
- 🛠
git bisect - 🛠
git diff-tree --patch - 🛠
git diff-tree --stat - 🛠
git diff-tree --compact-summary - 🛠
git diff-tree --numstat - 🛠
git diff-tree --shortstat - 🛠
git diff-tree --dirstat - 🛠
git diff-tree --summary - 🛠
git diff-tree -S<pattern> - 🛠
git diff-tree -G<pattern> - 🛠
git diff - ✔
git diff --name-status --cached - ✔
git diff --name-status(without--cached) - ✔
git grep - 🛠
git log- ✔
git log --name-status(src/Command/GetCommits.php) - 🛠
git log --full-diff - 🛠
git log -L<start>,<end>:<file> - 🛠
git log -L:<funcname>:<file>
- ✔
- 🛠
git show- ✔
git show [ref]:<filePath>(src/Command/GetFileContent.php)
- ✔
- ✔
git status - ✔
git ls-files - ✔
git ls-tree - ✔
git check-ignore - ✔
git check-attr
- 🛠
- grow, mark and tweak your common history
- 🛠
git backfill - ✔
git branch CREATE - ✔
git branch --list --verbose - ✔
git branch --move - ✔
git branch --set-upstream-to - ✔
git branch --delete - ✔
git commit - ✔
git merge - ✔
git rebase - ✔
git reset - 🛠
git checkout - ✔
git symbolic-ref <name> <ref>UpsertSymbolicRef - ✔
git symbolic-ref <name>ReadSymbolicRef - ✔
git symbolic-ref --delete <name>DeleteSymbolicRef - ✔
git switch - ✔
git tag CREATE - ✔
git tag --list --verbose - ✔
git tag --delete
- 🛠
- collaborate
- 🛠
git remote- ✔
git remote --verbose - ✔
git remote add - ✔
git remote rename - ✔
git remote remove - ✔
git remote update - ✔
git remote get-urlFetch, Push - ✔
git remote set-urlSet, Add, Delete - ✔
git remote prune - ✔
git remote set-branches - 🛠
git remote set-head - 🛠
git remote show
- ✔
- ✔
git fetch - ✔
git pull - ✔
git push
- 🛠
- config
- ✔
git config list - ✔
git config get - ✔
git config set - ✔
git config unset
- ✔
- other
- ✔
git --version - ✔
git --exec-path - 🛠
git fmt-merge-msg - 🛠 and a lot of other commands
- ✔
stdInput reader
stdInput reader - Supported Git hooks
stdInput reader - Usage
.git/hooks/pre-receive
#!/usr/bin/env php <?php use Sweetchuck\Git\StdInputReader\PreReceiveReader; $reader = new PreReceiveReader(\STDIN); foreach ($reader as $item) { echo 'Old value: ', $item->oldValue, \PHP_EOL; echo 'New value: ', $item->newValue, \PHP_EOL; echo 'Ref name: ', $item->refName, \PHP_EOL; echo '-----------', \PHP_EOL; }
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2024-12-23