{"id":25456427,"url":"https://github.com/autoframe/git-exec-hook","last_synced_at":"2026-04-18T00:32:10.688Z","repository":{"id":252513118,"uuid":"840526672","full_name":"autoframe/git-exec-hook","owner":"autoframe","description":"Http git hook call fo action for fetch pull checkout commit push","archived":false,"fork":false,"pushed_at":"2024-08-19T09:08:56.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-01T12:20:30.074Z","etag":null,"topics":["chehkout","commit","fetch","git","hook","pull","push"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/autoframe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-09T23:22:27.000Z","updated_at":"2024-08-19T09:08:59.000Z","dependencies_parsed_at":"2025-02-18T01:38:38.963Z","dependency_job_id":"cfe6e054-bf89-432a-a8ba-529c3f5f3c32","html_url":"https://github.com/autoframe/git-exec-hook","commit_stats":null,"previous_names":["autoframe/git-exec-hook"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/autoframe/git-exec-hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autoframe%2Fgit-exec-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autoframe%2Fgit-exec-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autoframe%2Fgit-exec-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autoframe%2Fgit-exec-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autoframe","download_url":"https://codeload.github.com/autoframe/git-exec-hook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autoframe%2Fgit-exec-hook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31951298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chehkout","commit","fetch","git","hook","pull","push"],"created_at":"2025-02-18T01:38:32.694Z","updated_at":"2026-04-18T00:32:10.654Z","avatar_url":"https://github.com/autoframe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autoframe is a low level framework that is oriented on SOLID flexibility\n## 👨🏼‍💻 git-exec-hook\n\n[![License: The 3-Clause BSD License](https://img.shields.io/github/license/autoframe/git-exec-hook)](https://opensource.org/license/bsd-3-clause/)\n![Packagist Version](https://img.shields.io/packagist/v/autoframe/git-exec-hook?label=packagist%20stable)\n[![Downloads](https://img.shields.io/packagist/dm/autoframe/git-exec-hook.svg)](https://packagist.org/packages/autoframe/git-exec-hook)\n\n# Http git hook call for action for fetch pull checkout commit push\n\n*Config with constants or constructor args*\n\n```php\n\ndefine('X_HUB_SIGNATURE','sha1 hook token'); //or use in AfrGitHook constructor\ndefine('X_HUB_SIGNATURE_256','sha256 hook token'); //or use sha 256 \n\n\ndefine('X_PATH_TO_GIT_REPO_DIR','path to current repo dir'); //or use in AfrGitExec constructor\n```\n\n---\n\n```php\n`AfrGitHook`\n\nuse Autoframe\\GitExecHook\\AfrGitHook;\nuse Autoframe\\GitExecHook\\AfrGitExec;\n\n//Hook example\n$oGhr = new AfrGitHook('HOOK_TOKEN', '', true);\n$gitExec = new AfrGitExec(__DIR__ . '/origin');\n\n//print_r($gitExec-\u003esetGitConfigDefault('autoframe','USER@gmail.com'));\n//print_r($gitExec-\u003egitCloneWithUserToken('https://github.com/autoframe/hx','USER','ghp_TOKEN'));\n\n\nif ($oGhr-\u003eisPushOnMasterBranch()) {\n    $aLog = $gitExec-\u003eallInOnePushCurrentThenSwitchToMasterPullAddCommitAndPush();\n    echo '\u003cpre\u003e';\n    print_r($aLog);\n    echo '\u003c/pre\u003e';\n}\n\n```\n\n---\n\n```php\n`AfrGitExec`\n\nuse Autoframe\\GitExecHook\\AfrGitExec;\n\n$gitExec = new AfrGitExec('/PATH_TO_GIT_REPO_DIR');\n\necho '\u003cpre\u003e';\nprint_r(\n    $gitExec-\u003egitAddCommitAndPush(\n        'Manual commit ' .  gmdate('Y-m-d H:i:s') . ' GMT',\n        $gitExec-\u003egetCurrentBranchName()\n    )\n);\necho '\u003c/pre\u003e';\n\n```\n\n---\n\n# 🚀 git install on Cpanel / WHM 🤖\n\n### 💻 Ubuntu\n\n    sudo apt update\n    sudo apt install git\n    git --version\n\n### 💻 CentOS 8\n\n    sudo dnf update -y\n    sudo dnf install git -y\n    git --version\n\n### 💻 CentOS 7\n    sudo yum update\n    sudo yum install git\n    git --version\n\n---\n\n# ⚙️ Config\n\n### ssh / gpg / armour / fingerprint\nhttps://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key\n\n    ssh-keygen -o\n\n### 📚 List current config\n\n    git config --list\n\n### 🛠️ Set config globally\n\n    git config --global user.name \"Your Name\"\n    git config --global user.email \"you@example.com\"\n\n    git config --global core.logallrefupdates true\n    git config --global core.autocrlf false\n    git config --global core.symlinks false\n    git config --global core.bare false\n    git config --global core.ignorecase true\n    git config --global core.eol lf\n\n### 🔧 Set config to current project\njust ignore ***--global***\n\n    cd ~/some-dir/project-dir\n\n# 🍀🌈🦄 Clone\n\n    cd ~/some-dir/project-dir\n    git clone git@github.com:autoframe/xxxx.git\n    git clone 'https://github.com/autoframe/xxxx.git'\n\n### ⛔ clone private repos\nCreate a new token for the repo: https://github.com/settings/tokens\n\n    git clone https://user:TOKEN@github.com/autoframe/repo/\n    git clone https://user:TOKEN@github.com/username/repo.git\n    git clone https://oauth2:\u003cYOUR-PERSONAL_ACCESS-TOKEN\u003e@github.com/\u003cyour_user\u003e/\u003cyour_repo\u003e.git\n    git clone https://\u003cpat\u003e@github.com/\u003cyour account or organization\u003e/\u003crepo\u003e.git\n\n\n### 📄 Afterward, you can do the following two steps to normalize all files:\n\n    git rm --cached -r .  ⚠️ Remove every file from git's index.\n    git reset --hard      ⚠️ Rewrite git's index to pick up all the new line endings.\n    git reset --hard HEAD~1 2\u003e\u00261 ⚠️ Rollback commits back to head\n\n---\n\n# ❗⚠️ Reset commands\n\n    git checkout .         #If you want to revert changes made to your working copy, do this:\n    git reset              #If you want to revert changes made to the index (i.e., that you have added), do this. Warning this will reset all of your unpushed commits to master!:\n    git clean -f           #If you want to remove untracked files (e.g., new files, generated files):\n    git clean -fd          #Or untracked directories (e.g., new or automatically generated directories):\n\n    git revert \u003ccommit 1\u003e \u003ccommit 2\u003e     #If you want to revert a change that you have committed, do this:\n\n# 🌐 Read from upstream\n    git pull        #Pull branch info\n    git fetch       #Refresh branches\n\n# 📥 Checkout\n    git checkout master     #Checkout master branch\n    git checkout -q master  #Quiet, suppress feedback messages.\n    git checkout -f master  #When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.\n\n### 🙈 checkout args\nhttps://git-scm.com/docs/git-checkout\n\n    -q, --quiet \nQuiet, suppress feedback messages.\n\n    -f, --force \nWhen switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.\n\n    -b\n**git checkout -b new-branch-name**\n\nCreate a new branch named \u003cnew_branch\u003e and start it at \u003cstart_point\u003e; see git-branch(1) for details.\n\n    -m, --merge\nWhen switching branches, if you have local modifications to one or more files that are different between the current branch and the branch to which you are switching, the command refuses to switch branches in order to preserve your modifications in context. However, with this option, a three-way merge between the current branch, your working tree contents, and the new branch is done, and you will be on the new branch.\n\n    --ours, --theirs\nWhen checking out paths from the index, do not fail upon unmerged entries; instead, unmerged entries are ignored.\n\n\n# 📤 Push\n\n    git diff\n    git add .\n    git commit -m \"#uztpOegQ comment info\"\n    git commit -m \"PROPT-6264 second commit\"\n\n    git push \u003cremote\u003e \u003cbranch\u003e\n    git push -u origin branch_name\n\n### 🙈 push args\nhttps://git-scm.com/docs/git-push\n\n    -u, --set-upstream\nFor every branch that is up-to-date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull[1] and other commands.\n\n    -q, --quiet\nSuppress all output, including the listing of updated refs, unless an error occurs. Progress is not reported to the standard error stream.\n\n    --all, --branches\nPush all branches (i.e. refs under refs/heads/); cannot be used with other \u003crefspec\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautoframe%2Fgit-exec-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautoframe%2Fgit-exec-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautoframe%2Fgit-exec-hook/lists"}