Shell script to automate the process of creating a remote repository and linking the same to the local repository just from the single command in the CLI.
Clone this repository to a desired destination and head inside the directory
$ git clone https://github.com/BugReportOnWeb/auto-repo-script.git
$ cd auto-repo-script
Copy the main script to the /usr/local/bin/
directory. Here <cmd-name>
refers to the name you give to the command. Executing it will run the script.
$ sudo cp src/main.sh /usr/local/bin/<cmd-name>
Head inside directory you want to start your project in (local repository without any git initialization).
$ cd <project-dir-path>
Run the command in the project directory.
$ <cmd-name>
Just remove the script from /usr/local/bin/
directory
$ sudo rm /usr/local/bin/<cmd-name>
- curl - command line tool and library for transferring data with URLs
-> Ubuntu/Debian: $ sudo apt install curl
-> RHEL/CentOS/Fedora: $ sudo yum install curl
-> Arch Linux: $ sudo pacman -S curl
After running the script, you will go through a short questionnaire about the information regarding the remote repository. Those questions are as follow:
- Name of the Repository
- Descption of the Repository
- Visibility of the Repository (o = Open/Public OR c = Close/Private)
- GitHub credentials (Username and Password)
Well that goes without saying that this piece of code is not optimised at its best. Without even looking it up, I can surely say numerous bugs might pop up in certain edge cases. Well if you find one, feel free to open an issue about it. Our team (yeah just me) will try to fix it as soon as possible. You can even open a PR if you already have a solution in your mind. Thank you!
- Error handling for none or wrong output in GitHub crendentials.
- [NOT-A-BUG] Outputing stderr of cURL to
/dev/null
- [FEATURE] Config files for GitHub credentials for auto fill