命令如下:
git show --pretty=format:"%s" -s HEAD
效果:
Python中获取:
import shlex
import subprocess
cmd = 'git show --pretty=format:"%s" -s HEAD'
r = subprocess.run(shlex.split(cmd), capture_output=True)
out = r.stdout.decode()
print(out)
命令如下:
git show --pretty=format:"%s" -s HEAD
效果:
Python中获取:
import shlex
import subprocess
cmd = 'git show --pretty=format:"%s" -s HEAD'
r = subprocess.run(shlex.split(cmd), capture_output=True)
out = r.stdout.decode()
print(out)