DEV Community

Cover image for Update: GitHub Repository Initialization Script.
Prithvi Yewale
Prithvi Yewale

Posted on

2

Update: GitHub Repository Initialization Script.

GitHub Repository Initialization Script
This Bash script is designed to automate the process of creating and initializing a Git repository, optionally pushing it to GitHub, and selecting a license.

Getting Started
Before using this script, make sure you have the following:

Instructions (mkgit.bash)

  1. Clone the repository to your local machine:

    git clone https://github.com/your-username/bash-github-repo-creator.git
    
  2. Navigate to the cloned directory:

    cd bash-github-repo-creator
    
  3. Make the script executable:

    chmod +x mkgit.bash
    
  4. Execute the script

    ./mkgit.bash [-d] [-i] [-l] [-h]
    

Flags

-d: Delete the configuration file and exit.
-i: Initialize a Git repository in the current directory.
-l: Prompt for license selection.
-h: Display the help message.

Runing script without any flags makes new repo without licence at $HOME/Documents/Projects

  1. The first time you use the script, it will prompt you to enter your GitHub credentials. These credentials will be saved in a configuration file for further use.

  2. To run the script globally.

copy the script to

/usr/local/bin

you can create a alias

alias mkgit='mkgit.bash'

  1. The script will create a new directory with the given repository name, initialize a Git repository, create an initial commit with a README file, and push it to the newly created GitHub repository.

Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. Make sure to follow the contribution guidelines.

  1. Fork the repository.
  2. Create your feature branch git checkout -b feature/AmazingFeature.
  3. Commit your changes git commit -m 'Add some AmazingFeature'.
  4. Push to the branch git push origin feature/AmazingFeature.
  5. Open a pull request.

contributors
Github.com/cosmicwanderer7
Github.com/Cybersnake223
Github.com/TanX-009

Top comments (1)

Collapse
 
aartikushwaha profile image
Aarti Kushwaha

Good work 👏

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay