Bash Script to automate git-push Operation - Bash Script program to automate git push operation , this program helps to automate the process of pushing files to remote repository on github . Refer to the following articles for more details ->
#! /bin/bash
echo "Enter the path where the files are present"
read path
cd $path
echo "*******************************************************"
echo "Initializing local repository with git"
git init
echo "*******************************************************"
echo "Adding all files to staging area"
git add .
echo "*******************************************************"
echo "commiting all changes"
git commit -m "first commit"
echo "Enter github username"
read username
echo "Enter github repository name"
read reponame
git remote add origin https://github.com/$username/$reponame.git
echo "********************************************************"
echo "pushing"
git push origin main --force
ย