modified git code retrieval function