{"id":19014388,"url":"https://github.com/parrondo/git_shellscript","last_synced_at":"2026-03-02T04:32:15.531Z","repository":{"id":88357572,"uuid":"115447012","full_name":"parrondo/git_shellscript","owner":"parrondo","description":"Useful shell scripts for Git","archived":false,"fork":false,"pushed_at":"2015-08-08T22:25:01.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-11T04:31:47.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://kenju.github.io/git_shellscript","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parrondo.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-26T18:50:10.000Z","updated_at":"2019-05-18T08:09:28.000Z","dependencies_parsed_at":"2023-02-27T08:26:07.719Z","dependency_job_id":null,"html_url":"https://github.com/parrondo/git_shellscript","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/parrondo/git_shellscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrondo%2Fgit_shellscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrondo%2Fgit_shellscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrondo%2Fgit_shellscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrondo%2Fgit_shellscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parrondo","download_url":"https://codeload.github.com/parrondo/git_shellscript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrondo%2Fgit_shellscript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29992306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-08T19:29:08.348Z","updated_at":"2026-03-02T04:32:15.514Z","avatar_url":"https://github.com/parrondo.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shell scripts for Git\n\n### About\n\nShell scripts for manipulating your Git repository. \n\n- [Github](https://github.com/KENJU/git_shellscript)\n- [Documentation](http://kenju.github.io/git_shellscript/)\n\n### Usage\n\nDownload a shell script whilch you want to use into your git repository, and then add permission for executing files with below commands.\n\n```bash\n$ chmod u+x init.sh\n``` \n\n## List\n\n- init.sh\n- commit.sh\n- push.sh\n- build.sh\n- github.sh\n- issue.sh\n\t- issue_list.sh\n\t- issue_create.sh\n\t- issue_edit.sh\n\n### init.sh\n\n- `git init`\n- create `.gitignore`\n- add file name to .gitignore\n\n```sh\n\n# define function\naddToGitignore () {\n\n\t# add filename to .gitignore\n\techo \"(hit q for quit)\"\t\n\twhile :\n\tdo\n\n\t\tread -p \"Type file name to add to .gitignore: \" filename\n\t\t# quit when\n\t\tif [ $filename = \"q\" ]\n\t\t\tthen\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\techo $filename \u003e\u003e .gitignore\n\t\tfi\n\n\n\tdone\n\n}\n\n# init\ngit init\n\n# .gitignore\nread -p \"Do you want to add .gitignore? (y/n)\" answer\n\n\ncase $answer in\n  y)\n\ttouch .gitignore\n\taddToGitignore\n    ;;\n  n)\n    ;;\n  *)\n    ;;\nesac\n\n```\n\n### commit.sh\n\n- just add all files\n- commit with commit messages\n\n```sh\n\n# add\ngit add -A\n\n# commit\nread -p \"Commit message: \" commitMessage\ngit commit -m \"$commitMessage\"\n\n```\n\n### push.sh\n\n- commit.sh\n- + can add tag\n- + push\n\n```sh\n\n# ( commit.sh... )\n\n# add tag\nread -p \"Do you want to add tag? (y/n)\" answer\n\ncase $answer in\n  y)\n    # show all tags\n    git tag\n    # add a new tag\n    read -p \"Tag Version: \" tagVersion\n    read -p \"Tagging Message: \" taggingMessage\n    git tag -a $tagVersion -m \"$taggingMessage\"\n    git push --tags\n    ;;\n  n)\n    ;;\n  *)\n    ;;\nesac\n\n# push\ngit push\n\n```\n\n### build.sh\n\n- push.sh\n- + push to `gh-pages` branch\n\n```sh\n\n# ( push.sh... )\n\n# build\ngit checkout gh-pages\ngit rebase master\ngit push origin gh-pages\ngit checkout master\n\n```\n\n### github.sh\n\n- create a new repo in Github\n- git init yoru current directory\n- git push to the newly created repo\n\n```sh\n\n#!/bin/sh\n# \n# github.sh\n# - create a new repository in Github\n#\n# Copyright (C) 2015 Kenju - All Rights Reserved\n# https://github.com/KENJU/git_shellscript \n\n# get user name\nusername=`git config github.user`\nif [ \"$username\" = \"\" ]; then\n\techo \"Could not find username, run 'git config --global github.user \u003cusername\u003e'\"\n\tinvalid_credentials=1\nfi\n\n# get repo name\ndir_name=`basename $(pwd)`\nread -p \"Do you want to use '$dir_name' as a repo name?(y/n)\" answer_dirname\ncase $answer_dirname in\n  y)\n\t# use currently dir name as a repo name\n\treponame=$dir_name\n    ;;\n  n)\n\tread -p \"Enter your new repository name: \" reponame\n\tif [ \"$reponame\" = \"\" ]; then\n\t\treponame=$dir_name\n\tfi\n    ;;\n  *)\n    ;;\nesac\n\n\n# create repo\necho \"Creating Github repository '$reponame' ...\"\ncurl -u $username https://api.github.com/user/repos -d '{\"name\":\"'$reponame'\"}'\necho \" done.\"\n\n# create empty README.md\necho \"Creating README ...\"\ntouch README.md\necho \" done.\"\n\n# push to remote repo\necho \"Pushing to remote ...\"\ngit init\ngit add -A\ngit commit -m \"first commit\"\ngit remote rm origin\ngit remote add origin https://github.com/$username/$reponame.git\ngit push -u origin master\necho \" done.\"\n\n# open in a browser\nread -p \"Do you want to open the new repo page in browser?(y/n): \" answer_browser\n\ncase $answer_browser in\n  y)\n\techo \"Opening in a browser ...\"\n\topen https://github.com/$username/$reponame\n    ;;\n  n)\n    ;;\n  *)\n    ;;\nesac\n\n\n```\n\n### issue.sh\n\n- list all issues of your current repository\n- add a new issue\n- edit issues\n\n#### issue_list.sh\n\n```sh\n\n\n###################\n# list issues\n###################\n\n# get user name\nusername=`git config github.user`\nif [ \"$username\" = \"\" ]; then\n\techo \"Could not find username, run 'git config --global github.user \u003cusername\u003e'\"\n\tinvalid_credentials=1\nfi\n\n# get repository name\nrepo_name=`basename $(git rev-parse --show-toplevel)`\n\n# list all issue\ncurl https://api.github.com/repos/$username/$repo_name/issues \u003e issues.txt\n\n# extract texts\nawk '/number/{print $2}' issues.txt \u003e tmp1.txt\nawk '/title/{result = \"\"; for(i=2;i\u003c=NF;++i) result = result \" \" $i; print result}' issues.txt \u003e tmp2.txt\n\n# formats\necho \"=========================\"\necho \"No.\\tTitle\"\necho \"-------------------------\"\npaste -d\"\\t\" tmp1.txt tmp2.txt | tr -d \\\",\necho \"=========================\"\n\n# cleanup\nrm tmp{1,2}.txt\nrm issues.txt\n\n```\n\n#### issue_create.sh\n\n```sh\n\n###################\n# create an issue\n###################\n\n# POST\nread -p \"Do you want to add issues? (y/n)\" answer_add\ncase $answer_add in\n  y)\n\tread -p \"Issue Title: \" title\n\tread -p \"Issue Body: \" body\n\tcurl -u $username -i -H \"Content-Type: application/json\" -X POST --data '{\"title\":\"'$title'\", \"body\":\"'$body'\"}' https://api.github.com/repos/$username/$repo_name/issues\n    ;;\n  n)\n    ;;\n  *)\n    ;;\nesac\n\n```\n\n#### issues_edit.sh\n\n```sh\n\n###################\n# edit an issue\n###################\n\n# POST\nread -p \"Do you want to edit issues? (y/n)\" answer_edit\ncase $answer_edit in\n  y)\n\t# get issue num\n\tread -p \"Issue Number: \" issue_num\n\n\t# get issue detail\n\tcurl https://api.github.com/repos/$username/$repo_name/issues/$issue_num \u003e issues$issue_num.txt\n\n\t# format and show detail\n\t\"=========================\"\n\tgrep 'number' issues$issue_num.txt | tr -d \\\",\n\techo \"-------------------------\"\n\tgrep 'state' issues$issue_num.txt | tr -d \\\",\n\tgrep 'closed_at' issues$issue_num.txt | tr -d \\\",\n\tgrep 'created_at' issues$issue_num.txt | tr -d \\\",\n\tgrep 'updated_at' issues$issue_num.txt | tr -d \\\",\n\techo \"-------------------------\"\n\tgrep 'title' issues$issue_num.txt | tr -d \\\",\n\tgrep 'body' issues$issue_num.txt | tr -d \\\",\n\techo \"=========================\"\n\n\t# get new status/title/body\n\tread -p \"New state ( open or closed ): \" new_state\n\tread -p \"New title : \" new_title\n\tread -p \"New body : \" new_body\n\n\t# POST\n\tcurl -u $username -i -H \"Content-Type: application/json\" -X POST --data '{\"title\":\"'$new_title'\", \"body\":\"'$new_body'\", \"state\":\"'$new_state'\"}' https://api.github.com/repos/$username/$repo_name/issues/$issue_num\n\n\t# cleanup\n\trm issues$issue_num.txt\n\n    ;;\n  n)\n    ;;\n  *)\n    ;;\nesac\n\necho\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparrondo%2Fgit_shellscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparrondo%2Fgit_shellscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparrondo%2Fgit_shellscript/lists"}