{"id":19982111,"url":"https://github.com/denghuiquan/githubremotecreate-cli","last_synced_at":"2025-06-25T19:02:40.677Z","repository":{"id":49036434,"uuid":"517136310","full_name":"denghuiquan/githubremotecreate-cli","owner":"denghuiquan","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-23T18:46:06.000Z","size":14121,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T19:02:22.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"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/denghuiquan.png","metadata":{"files":{"readme":"README.md","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":"2022-07-23T18:34:17.000Z","updated_at":"2022-07-23T18:40:19.000Z","dependencies_parsed_at":"2022-09-08T15:10:17.694Z","dependency_job_id":null,"html_url":"https://github.com/denghuiquan/githubremotecreate-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/denghuiquan/githubremotecreate-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denghuiquan%2Fgithubremotecreate-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denghuiquan%2Fgithubremotecreate-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denghuiquan%2Fgithubremotecreate-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denghuiquan%2Fgithubremotecreate-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denghuiquan","download_url":"https://codeload.github.com/denghuiquan/githubremotecreate-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denghuiquan%2Fgithubremotecreate-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261937022,"owners_count":23232843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-13T04:09:15.047Z","updated_at":"2025-06-25T19:02:40.654Z","avatar_url":"https://github.com/denghuiquan.png","language":"JavaScript","readme":"# githubremotecreate\n\nProject Url: [https://github.com/denghuiquan/githubremotecreate](https://github.com/denghuiquan/githubremotecreate)\n\n# githubremotecreate-cli\n\nProject Url: [https://github.com/denghuiquan/githubremotecreate-cli](https://github.com/denghuiquan/githubremotecreate-cli)\n\n目录\n- 1. **步骤**\n- 2. **运行结果对比**\n- 3. **一些问题**\n- 4. **补充一些git命令**\n  - 4.1 新建一个文件，并写入\n  - 4.2 添加到暂存区\n  - 4.3 提交到本地仓库\n  - 4.2 提交到远程仓库\n\n\u003e **背景**：在使用github时，发现若是在本地终端要创建github仓库，每次都要进入到 github主页，或者使用github cli很不方便。\n话不多说，直接开始。\n\n\n1. 步骤\n    环境：\n   - 我的github用户名：denghuiquan\n   - github token：网上有很多教程，不细讲。可以参考此链接：[Creating a personal access token](https://docs.github.com/cn/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)\n\n系统配置的`~/.gitconfig` 配置`name` 和 `token`\n\n```ini\n[user]\n\tname = denghuiquan\n\temail = 980352129@qq.com\n\ttoken = ghp_E**********************p4v\n```\n你只需要把name、token 换成你的github用户名和对应的access—token（注意共有两处）就可以了。\n\n或者把token配置到项目根目录下的： `.token.ini`\n```\n[Github]\naccess_token = ghp_E**********************p4v\n```\n如果采用这种局部配置的方式，为避免用户access-token泄露，记得在.gitignore文件中添加一行内容为`.token.ini`，用于忽律该文件，不把它传到git仓库中。\n\n准备工作做好后，就可以开始了。\n\n好啦，现在就可以愉快地一键部署github仓库了。\n\n2. 运行结果对比\n    运行githubremotecreate-cli前提示确保远端有仓库\n\n    我们打开终端，创建新的文件夹后开始执行githubremotecreate-cli命令\n    按照提示完成配置过后，就会创建出相应的远端仓库，并尝试添加到当前目录的git config中作为remote origin url \n\n    运行github-create后\n\n    我们先看看本地，创建了一个以该目录命名的repository，如果当前目录不存在README.md文件则创建，若存在则把项目名跟远端仓库地址记录到其中。\n\n    接下来我们进入到github网页中查看，刷新可以看到多了一个当前创建的仓库\n\n1. 好了，本教程到这里就结束了。\n\n    现在就可以愉快地在终端一键部署github repository了😝\n\n4. 补充一些git命令\n- 4.1 新建一个文件，并写入\n    touch hello.txt\n    echo \"hello world\\!\" \u003e\u003e hello.txt\n- 4.2 添加到暂存区\n    git add hello.txt\n- 4.3 提交到本地仓库\n    git commit -m \"add hello.txt\"\n- 4.2 提交到远程仓库\n    git push origin master\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenghuiquan%2Fgithubremotecreate-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenghuiquan%2Fgithubremotecreate-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenghuiquan%2Fgithubremotecreate-cli/lists"}