I'm no git expert, but I think you have a choice of:
trev@macmini8 [/usr/local/share/fpcsrc/3.3.1] $ git describe
3.3.1-9458-gc616832792
trev@macmini8 [/usr/local/share/fpcsrc/3.3.1] $ git rev-parse HEAD
c6168327925ff1bc96f06fe9df952b147bf2b8de
trev@macmini8 [/usr/local/share/fpcsrc/3.3.1] $ git rev-parse --short HEAD
c616832792
trev@macmini8 [/usr/local/share/fpcsrc/3.3.1] $ git log -1
commit c6168327925ff1bc96f06fe9df952b147bf2b8de (HEAD -> main, origin/main, origin/HEAD)
Author: Pierre Muller <pierre@...>
Date: Mon Oct 18 22:41:38 2021 +0000
Disable utils packages for wasi OS if required package is not supported or if labels are
used (which is not supported for wasm32 target CPU)
To checkout the same clone at a later date:
git clone [remote_repo] my_repo
cd my_repo
git reset --hard c6168327925ff1bc96f06fe9df952b147bf2b8de
Or, with an up to date clone, you could simply re-create it with a new branch:
git checkout -b new_branch_name c6168327925ff1bc96f06fe9df952b147bf2b8de
[Edit answer part 2 of question]