refactored git before action and primary privilages