Sharing a method for one-click packaging and uploading Hugo to GitHub, assuming you have previously uploaded to a GitHub repository.
Use a sh executable file supported by Windows, create a hugo.sh file in the root directory, and put some commands in it.
hugo
# cd public
time=$(date "+%Y-%m-%d %H:%M:%S")
echo $time
git add .
git commit -m "Automated build script execution 🎓$time"
git push
exit
You can double-click the hugo.sh file in the folder to run it, or enter the command in the terminal.
.\hugo.sh
This eliminates the need for me to enter tedious Git upload commands and automatically generates the current system time as the commit.
Other
Here I am uploading the entire Hugo directory. If you only want to upload the generated /public, add cd public in the middle.