python中执行git clone 命令,怎样在工程clone完成后执行另一个方法
1个回答
展开全部
直接执行
下面是一种解决方案
1 把gitbash 的路径放到系统的Path环境变量里 我的是 C:\Program Files (x86)\Git\bin
2 这时候 你在系统命令行里就可以用git了
3 在python里倒入 os 模块 然后执行
os.system('git') 就可以了
C:\Users\Administrator>python
Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win3
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system('git')
usage: git [--version] [--help] [-C <path>] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the wo
下面是一种解决方案
1 把gitbash 的路径放到系统的Path环境变量里 我的是 C:\Program Files (x86)\Git\bin
2 这时候 你在系统命令行里就可以用git了
3 在python里倒入 os 模块 然后执行
os.system('git') 就可以了
C:\Users\Administrator>python
Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win3
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system('git')
usage: git [--version] [--help] [-C <path>] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the wo
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询