accessing git command using subprocess with arcpy on linux ArcGIS server

506
0
11-17-2020 10:48 PM
jiyeam
by
New Contributor

Hello,

I'm currently having an issue with accessing git hash using the subprocess module from the python on Linux ArcGIS server.

I'm using ArcGIS 10.8 Linux server version and using the python interpreter on the server at the default location (/home/usr/server/tools/python)

My code snippet is 

a = subprocess.Popen(['git rev-parse HEAD'], cwd=os.path.dirname('/home/usr/server/my_project'), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
a.communicate()

 

When I run this command, it returns 

('', "Can't recognize 'git' as an internal or external command, or batch script.\r\n")

 

Has anybody had a similar issue before?

Thank you in advance

 

0 Kudos
0 Replies