How will I maintain versioning of civicrm in github?
It's really bad idea to customize CiviCRM core files when you can do thing using extensions. If you feel your customization fixes core issues than you should try to submit pull request against civicrm-core. If your changes are client specific than you can either move those files into custom php or custom template(again bad idea since its very difficult to maintain for future upgrade) or implement JS/hooks. There are many hooks available in CiviCRM where you can alter the content of website or perform additional function that is missing for example sending emails to group admin when a contact is created or change the content of Thank you page of Contribution or Membership signup or Event registration.

If you want to maintain the versioning of db then I would suggest to create extension and implement install/upgrade hook to create/update/delete custom fields or any settings in this way you can version your extension and can deploy on various instances without any hassle. There are also various migration tools available in CiviCRM which is responsible to migrate custom fields, contact types etc from one instance to another. You can also use them to copy your custom fields over staging or production instances.

https://www.drupal.org/project/civicrm_field_migrate
https://github.com/CiviCooP/org.civicoop.configitems
https://github.com/catorghans/net.trinfinity.orgis.mi.dataquality
https://github.com/xurizaemon/civicrm-configexport