Skip to content

Automatically create a new Github repository with Simple bash script & Python Web Scraping practice.

Notifications You must be signed in to change notification settings

yenjuu/repo-create

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

自動建立新 Github repository

簡單的 Bash script + Python 爬蟲練習

把每次新增專案的流程自動化,在 terminal 輸入 create [專案名稱]就可以做到以下流程:

新增資料夾 --> git init --> 新增git repo --> git remote 等 --> 開啟vscode

[20230327更新]: 若Github有設定兩步驟驗證,會無法使用網頁爬蟲的方式新增並連結到github repo 只能改用script建立local repo並等待使用者輸入git remote url。

Automatically create a new Github repository by a simple command

Simple bash script & Python Web Scraping practice

Automate my process of creating a new project with entering create-github <project name> in terminal to achieve the following process:

create project folder --> git init --> create git repository --> git remote etc. --> open vscode

How to use

Custom command has two function:

  • create(): Only create a new local repository, you need to enter remote repository url (e.g. github/gitlab) by yourself.
  • create-github(): If you haven't set up two-way authentication, you can use this function to create a new repository and link it to github automatically.

Steps:

  1. Create a new folder for your custom command
  2. Copy my-cmd.sh to the folder you create
  3. Open my-cmd.sh and change the following variable to your local setting:
    • CMDIR: your custom command folder path
    • PROJECT_ROOT: your project root path
  4. Add execution permission
chmod +x .my-cmd.sh
  1. Add custom command to ~/.zshrc
vim ~/.zshrc
# add 
source ~/your-custom-command-folder-path/.my-cmd.sh
  1. Source zshrc
source ~/.zshrc

Then you can run the commands in my-cmd.sh by using th following command:

create <project-name>

OR

create-github <project-name>

Result

image

參考資料

About

Automatically create a new Github repository with Simple bash script & Python Web Scraping practice.

Topics

Resources

Stars

Watchers

Forks