updated code to enable pushing of a file

Credits to github user : shakethat