mysqldump - select table in database only if it contains a specific string
What you need is a tool for controlling migrations and upload them to git a.k.a. a version control for MySQL. While you can deploy your own, this is a very well known problem and there are many tools available, some of them free and open source. I am not going to recommend you anything in particular, as they are different on the goals/features/integration with frameworks, but here it is a list of options:


Liquibase 
Flyway 
c5-db-migration 
dbdeploy 
MyBatis
Autopatch
Sqitch
online-migration


Some recommended readings: http://en.wikipedia.org/wiki/Schema_migration, http://www.liquibase.org/quickstart and http://www.percona.com/live/mysql-conference-2013/sites/default/files/slides/PLMCE13_online-migration.pdf

If you still want to deploy your own tool (not recommended), have a look at least at mysqldbcompare from mysqlutils and some of the percona-toolkit tools.