Skip to main content

Command Palette

Search for a command to run...

Bash Script to automate git-push

Updated
1 min read
Bash Script  to automate git-push
S

Welcome to my blog 👋🏽

I'm a Tech Enthusiast with a passion of learning!

I write about Programming and Productivity Tips ✅

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

More from this blog

Untitled Publication

16 posts