How should one go about using Craft with Git? [not duplicate]
Have a look at the project config feature in craft 3.1, it generates a yaml file describing all developer created data, e.g. fields, sections etc. which can be stored in GIT. However this does not save user created data e.g entries.

https://docs.craftcms.com/v3/project-config.html

Also look at migrations; php scripts to create schema / data in DB. (Which can be stored in GIT) Migration Manager plugin will auto generate them for you

https://docs.craftcms.com/v3/extend/migrations.html

https://packagist.org/packages/firstborn/migrationmanager