I created this bash script to make it easy to publish your files to a GitHub repository.
#!/bin/bash
echo "Welcome to the GitHub File Publishing Tool (GHFP for short)"
read -p "Continue? " yn
case $yn in
[Yy]* ) echo "Continuing the program...";;
[Nn]* ) echo "Stopping the program"; exit;;
esac
echo "Your remote will be shown below."
git remote
read -p "What is the remote of your repository? See above for the remote. " REMOTE
echo "Your main branch will be shown below."
git remote show $REMOTE | sed -n '/HEAD branch/s/.*: //p'
read -p "What branch would you like to write changes to? For example, enter master for main/default branch. " BRANCH
echo "The number of commits for branch" $BRANCH "will show below."
git rev-list --count $BRANCH
git add .
read -r -p "Commit name/number/identifier: " NUM
git commit -m $NUM
git push
Can anyone provide some ideas for improvement?
Below is the output of the file (running for a repository with no new changes)
bash gitpush.sh
Welcome to the GitHub File Publishing Tool (GHFP for short)
Continue? y
Continuing the program...
Your remote will be shown below.
upstream
What is the remote of your repository? See above for the remote. upstream
Your main branch will be shown below.
master
What branch would you like to write changes to? For example, enter master for main/default branch. master
The number of commits for branch master will show below.
18
Commit name/number/identifier: 19
On branch master
Your branch is up to date with 'upstream/master'.
nothing to commit, working tree clean
Everything up-to-date