Answers
Here are the answers to the questions given above:
- Use the
git
maintenance
command. - First, check the branch and HEAD reflogs if the lost committing question is not readily available from there. If this fails, you can try to browse through unreachable commits with
git fsck
. - You can use the “
Git trace
” mechanism – for example, with theGIT_TRACE2_PERF
orGIT_TRACE_PERFORMANCE
environment variables. - Use your software forge features, if possible (for example, to protect a branch against changes or deletion), or use server-side hooks. Enforcing the policy can be helped, but not ensured, with client-side hooks.
- Simply create the bare repository with
git init --bare --shared
, while ensuring that all developers that need access to it have appropriate filesystem permissions. If necessary, push to that repository.