diff --git a/push-to-gitea.sh b/push-to-gitea.sh index 1419a5c..1ca2a02 100644 --- a/push-to-gitea.sh +++ b/push-to-gitea.sh @@ -25,9 +25,9 @@ git add . echo "Files added." echo "Step 3: Creating the first commit..." -# Check if a commit already exists to avoid errors on re-run -if git rev-parse -q --verify HEAD; then - echo "A commit already exists. Skipping commit." +# Only commit if there are changes to be committed. +if git diff-index --quiet HEAD --; then + echo "No changes to commit. Skipping commit." else git commit -m "Initial commit of EstimateFlow project" echo "Initial commit created." @@ -50,7 +50,8 @@ fi echo "Step 5: Pushing your code to Gitea..." -git push -u origin main +# The error was here. Your branch is called 'EstimateFlow', not 'main'. +git push -u origin EstimateFlow echo "" echo "✅ All done! Your code has been pushed to your Gitea repository."