Sto provando ad eseguire un semplice comando git usando il seguente script python.cercando di eseguire il comando git usando lo script python
#!/usr/bin/python
import commands
import subprocess
import os
import sys
pr = subprocess.Popen("/usr/bin/git log" , cwd = os.path.dirname('/ext/home/rakesh.kumar/workspace/myproject'), shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
(out, error) = pr.communicate()
print "Error : " + str(error)
print "out : " + str(out)
ma sto ottenendo il seguente errore anche se sto facendo funzionare lo script Python nella stessa directory in cui git reposetory è.
Error : fatal: Not a git repository (or any of the parent directories): .git
sospettavo il git potrebbe ottenuto correputed, ma i file git sono belle e comandi git funziona se eseguo il prompt dei comandi normali.
Ho provato a cercare in rete ma non ho potuto ottenere informazioni utili. Per favore aiutatelo sarà molto apprezzato.
Cosa c'è di sbagliato nel codice che include 79 caratteri? –