Exit when someone ssh connect to the server without git push

When some ssh connect to the server. It will still go to the hook part. Exit if it is not git push.