I made a python script using
p = subprocess.Popen('git push --tag origin HEAD:develop' ,stdout=subprocess.PIPE,stderr=subprocess.STDOUT')
result = p.communicate()
print ("Result from GIT: " + result)
Result from GIT: To https://example.org/someUser/repo.git
fe4929f6..25bb62e9 HEAD -> develop
* [new tag] 18.104.22.168 -> 22.214.171.124
Counting objects: 25, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (25/25), 2.18 KiB | 0 bytes/s, done.
Total 25 (delta 20), reused 0 (delta 0)
828b9e31..249be2ba HEAD -> develop
When running git, you need to add the
From the git manual (run
git help push)
Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal.
This can be integrated in your program as follows:
p = subprocess.Popen('git push --progress --tag origin HEAD:develop' ,stdout=subprocess.PIPE,stderr=subprocess.STDOUT') result = p.communicate() print ("Result from GIT: " + result)
Notice that using this flag may make the parsing of the output of the script harder, as human readable output of git may change in future releases of git without warning. (Use
--porcelain to do the opposite of what you asked, produce machine readable output always)