Here's a full example of a bat file I use to get information about my project. There are some other options but I find this one to be the most readable and keeps the intent of the script as close as possible to what would be done on the cmd line.
Put this file in your path env variable and you can run it for any project you have locally.
This file is checked in here:
https://github.com/NACHC-CAD/bat/tree/main/files
@echo off
echo.
echo.
echo ------
echo Cloned from:
git config --get remote.origin.url
echo ------
echo.
echo ------
:: get the branch
git rev-parse --abbrev-ref HEAD > temp.txt
set /p branch=<temp.txt
echo Branch: %branch%
:: get the date
git show -s --format=%%ci > temp.txt
set /p date=<temp.txt
echo Date: %date%
:: get the hash
git show -s --format=%%H > temp.txt
set /p sha=<temp.txt
echo SHA: %sha%
:: clean up
del temp.txt
:: done
echo ------
echo.
echo.
echo Done.
echo.
echo.
Output is here:
D:\_WORKSPACES\_ECLIPSE_WORKSPACE\workspace\bat>where-am-i-really
------
Cloned from:
https://github.com/NACHC-CAD/bat
------
------
Branch: main
Date: 2022-05-12 14:40:03 -0400
SHA: 6fc95b29192fd65b2b16574ece6f20ba64ab1b59
------
Done.
D:\_WORKSPACES\_ECLIPSE_WORKSPACE\workspace\bat>