Skip to content

Instantly share code, notes, and snippets.

@kalilinux-png
Created May 21, 2024 18:15
Show Gist options
  • Save kalilinux-png/3817ae3996accaef37b3c3287f4be1ff to your computer and use it in GitHub Desktop.
Save kalilinux-png/3817ae3996accaef37b3c3287f4be1ff to your computer and use it in GitHub Desktop.
This is a script for automating the creation of a GitHub repository.
#!/bin/bash
# Get the current directory name
REPO_NAME=$(basename "$PWD")
# Create a .gitignore file
cat << EOF > .gitignore
# Node.js
node_modules/
# Python
__pycache__/
*.py[cod]
*.pyd
*.pyo
*.pyz
*.pyc
# React / build
build/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# Nuxt generate
dist
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.yarn/releases
# IDE / editors
.idea/
.vscode/
*.swp
*.swo
*.swn
*.bak
EOF
# Get the current date
START_DATE=$(date)
# Create a README.md file
cat << EOF > README.md
# Project Name: $REPO_NAME
## Start Date: $START_DATE
## Description:
This is a project named $REPO_NAME. It was started on $START_DATE.
## Installation:
To install the project, follow these steps:
1. Clone the repository
2. Run 'npm install'
## Usage:
To use the project, run 'npm start'
## Contributing:
To contribute to the project, please submit a pull request.
## License:
This project is licensed under the MIT License.
EOF
# Initialize a new git repository
git init
# Add all files to the repository and commit them
git add .
git commit -m "Initial commit"
# Create a new GitHub repository
echo "Creating GitHub repository"
gh repo create $REPO_NAME --private --source=. --remote=origin --push --add-readme
# Push the committed files to the new GitHub repository
git push -u origin main
@kalilinux-png
Copy link
Author

kalilinux-png commented Jun 2, 2024

use the this 👇 to download and execute directly
curl https://gist.githubusercontent.com/kalilinux-png/3817ae3996accaef37b3c3287f4be1ff/raw/2919ae60a800a097834e667e005c618c0a116d1b/gitAutomation.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment