summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPseudozoid <sarathmadhavr@gmail.com>2025-01-29 01:54:22 +0530
committerPseudozoid <sarathmadhavr@gmail.com>2025-01-29 01:54:22 +0530
commit6e692aa94f88b88281d306b214d0151b24bce943 (patch)
tree35b62bfdb4fac98c41322d8a09f4b3a28623e349
parent4f0937d016484406a2a0edc791056fb4d05f2b76 (diff)
added linux support
-rw-r--r--gitsetup.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/gitsetup.sh b/gitsetup.sh
new file mode 100644
index 0000000..5089257
--- /dev/null
+++ b/gitsetup.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Usage: ./gitsetup.sh <repo-name> <commit-message> [--private|--public]
+if [ "$#" -lt 2 ]; then
+ echo "Usage: $0 <repo-name> <commit-message> [--private|--public]"
+ exit 1
+fi
+
+REPO_NAME=$1
+COMMIT_MSG=$2
+VISIBILITY=${3:-"--private"}
+
+git init
+git add .
+git commit -m "$COMMIT_MSG"
+
+if [ "$VISIBILITY" == "--private" ]; then
+ gh repo create "$REPO_NAME" --private
+elif [ "$VISIBILITY" == "--public" ]; then
+ gh repo create "$REPO_NAME" --public
+else
+ echo "Invalid visibility option. Use --private or --public."
+ exit 1
+fi
+
+# Change github_username to your github username below
+git remote add origin git@github.com:github_username/"$REPO_NAME".git
+git push -u origin main
+