Automate GitHub repository creation with one command
Gitstart is a powerful Bash script that automates the entire process of creating a new Git repository and pushing it to GitHub. Instead of running multiple commands, you can initialize a complete project with proper structure in one line.
Before Gitstart:
mkdir my-project
cd my-project
git init
touch README.md LICENSE .gitignore
# ... manually create files ...
git add .
git commit -m "Initial commit"
gh repo create my-project --public
git remote add origin [email protected]:username/my-project.git
git push -u origin mainWith Gitstart:
gitstart -d my-project -l python⨠Complete Automation
- Creates directory structure
- Initializes Git repository
- Creates GitHub repository
- Generates LICENSE, README.md, .gitignore
- Commits and pushes to GitHub
π― Smart File Generation
- Language-specific .gitignore files (Python, JavaScript, Go, Rust, etc.)
- Multiple license options (MIT, Apache 2.0, GNU GPLv3)
- Professional README.md template
π§ Flexible Configuration
- Public or private repositories
- Custom branch names
- Custom commit messages
- Repository descriptions
- Dry-run mode to preview changes
π‘οΈ Safe and Reliable
- Detects existing files and prompts before overwriting
- Works with existing Git repositories
- Automatic cleanup on errors
- Comprehensive error handling
π§ͺ Well Tested
- Automated test suite with shellcheck and bats
- CI/CD pipeline with GitHub Actions
- Unit and integration tests
- Cross-platform compatibility (Linux, macOS)
π Cross-Platform
- Works on macOS, Linux (Ubuntu, Debian, Fedora, Arch)
- WSL2 support for Windows users
- Tested on both platforms via CI/CD
- OS-aware .gitignore generation
# Install (macOS)
brew tap shinokada/gitstart && brew install gitstart
# Login to GitHub
gh auth login
# Create your first repository
gitstart -d my-awesome-project
# That's it! Your project is now on GitHubbrew tap shinokada/gitstart && brew install gitstartawesome install shinokada/gitstart# Download from releases page
wget https://github.com/shinokada/gitstart/releases/download/v0.4.1/gitstart_0.4.1_all.deb
sudo apt install ./gitstart_0.4.1_all.deb# Manual installation (no rpm package yet)
curl -o gitstart https://raw.githubusercontent.com/shinokada/gitstart/main/gitstart
chmod +x gitstart
sudo mv gitstart /usr/local/bin/# Manual installation (AUR package coming soon)
curl -o gitstart https://raw.githubusercontent.com/shinokada/gitstart/main/gitstart
chmod +x gitstart
sudo mv gitstart /usr/local/bin/# Use Ubuntu/Debian instructions
wget https://github.com/shinokada/gitstart/releases/download/v0.4.1/gitstart_0.4.1_all.deb
sudo apt install ./gitstart_0.4.1_all.debcurl -o gitstart https://raw.githubusercontent.com/shinokada/gitstart/main/gitstart
chmod +x gitstart
sudo mv gitstart /usr/local/bin/
# Or install to user directory (no sudo needed)
mkdir -p ~/.local/bin
mv gitstart ~/.local/bin/
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc- GitHub CLI (
gh) - Installation guide - jq - JSON processor
- Git - Version control
- Bash - Shell (pre-installed on macOS/Linux)
# macOS
brew install gh jq
# Ubuntu/Debian
sudo apt install gh jq
# Fedora
sudo dnf install gh jq
# Arch Linux
sudo pacman -S github-cli jq
# Verify installation
gh --version
jq --version# Create a new repository
gitstart -d project-name
# With programming language
gitstart -d my-app -l python
# Private repository
gitstart -d secret-project -p
# In current directory
cd existing-project
gitstart -d .gitstart [OPTIONS]
Options:
-d, --dir DIR Directory name or path (required)
-l, --lang LANGUAGE Programming language for .gitignore
-p, --private Create private repository (default: public)
-b, --branch NAME Branch name (default: main)
-m, --message MESSAGE Initial commit message (default: "Initial commit")
-desc, --description TEXT Repository description
--dry-run Preview without executing
-q, --quiet Minimal output
-h, --help Show help
-v, --version Show versionPython Project
gitstart -d my-python-app -l pythonPrivate React App
gitstart -d react-app -l javascript -p -desc "My React application"Custom Everything
gitstart -d full-config \
-l go \
-p \
-b develop \
-m "Project initialization v1.0" \
-desc "A fully configured Go project"Preview Before Creating
gitstart -d test-project --dry-runPython β’ JavaScript β’ Node β’ TypeScript β’ Go β’ Rust β’ Java β’ C β’ C++ β’ C# β’ Ruby β’ PHP β’ Swift β’ Kotlin β’ Scala β’ Dart β’ Elixir β’ Haskell β’ Perl β’ R β’ Lua β’ and more!
Full list: https://github.com/github/gitignore
π Comprehensive Guides:
- Quick Reference - One-page command reference
- Examples - Real-world usage examples
- Testing Guide - Test procedures and validation
- Migration Guide - Upgrade from v0.3.0
- Changelog - Version history
π Major Update!
- β Private repository support
- β Custom commit messages
- β Custom branch names
- β Repository descriptions
- β Dry-run mode
- β Quiet mode for automation
- β Full support for existing directories
- β Automatic error cleanup
- β Better file conflict handling
- β XDG-compliant config location
See CHANGELOG.md for complete details.
gitstart -d new-idea -l python
cd new-idea
# Start coding immediately!gitstart -d team-project \
-l javascript \
-b develop \
-desc "Team collaboration project"cd ~/Downloads/client-project
gitstart -d . -l gofor service in user-svc payment-svc notification-svc; do
gitstart -d "$service" -l go -p -q
done#!/bin/bash
create_repo() {
gitstart -d "$1" -l "${2:-python}" -q
}
create_repo "api-service" "go"
create_repo "web-frontend" "javascript"- Validates - Checks GitHub authentication and dependencies
- Creates - Makes directory (if needed) and GitHub repository
- Initializes - Sets up Git with proper configuration
- Generates - Creates LICENSE, README.md, and .gitignore
- Commits - Stages and commits all files
- Pushes - Uploads to GitHub with proper remote setup
Gitstart stores your GitHub username in:
~/.config/gitstart/config
On first run, you'll be prompted to enter it. This follows XDG Base Directory standards.
"Not logged in to GitHub"
gh auth login"jq not found"
# macOS
brew install jq
# Ubuntu/Debian
sudo apt install jq"Repository already exists"
# Delete existing repo
gh repo delete username/repo-name --yes
# Or use different name
gitstart -d repo-name-v2Config not found
- Will prompt for username on first run
- Manually set:
echo "your-username" > ~/.config/gitstart/config
curl -s https://raw.githubusercontent.com/shinokada/gitstart/main/uninstall.sh | bashOr manually:
# Remove script
sudo rm /usr/local/bin/gitstart # or your installation path
# Remove config
rm -rf ~/.config/gitstartGitstart has a comprehensive test suite using shellcheck (static analysis) and bats (functional testing).
# Run all tests
make test
# Or use the test runner directly
./tests/run-tests.sh
# Run specific tests
make test-shellcheck # Static analysis only
make test-unit # Unit tests only# Install test dependencies
make install-deps
# Or manually:
brew install shellcheck bats-core # macOS
sudo apt install shellcheck bats # Ubuntu/DebianAll tests:
./tests/run-tests.shShellcheck only:
./tests/shellcheck.shBATS unit tests:
bats tests/gitstart.batsSpecific test:
bats tests/gitstart.bats --filter "version"Tests automatically run on push/PR via GitHub Actions:
- β ShellCheck static analysis
- β Unit tests on Ubuntu and macOS
- β Bash compatibility checks
- β Security scanning
See tests/README.md for detailed testing documentation.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
make testor./tests/run-tests.sh - Ensure all tests pass
- Submit a pull request
For detailed testing guidelines, see tests/README.md.
- π Bug Reports: GitHub Issues
- π¬ Questions: GitHub Discussions
- π§ Contact: @shinokada
MIT License - see LICENSE file for details.
Copyright (c) 2021-2026 Shinichi Okada
Shinichi Okada (@shinokada)
Thanks to all users who have provided feedback and contributed to making Gitstart better!
Star β the repo if you find it useful!