python中git_python如何使用gitbash执行git命令
展开全部下面是一种解决方案21131 把gitbash 的路径5261放到系统的Path环境变量里 我的是 C:\Program Files (x86)\Git\bin2 这时4102候 你在系统命令行里就1653可以用git了3 在python里倒入 os 模块 然后执行os.system('git') 就可以了C:\Users\Administrator>pythonPython 2.7.8
展开全部
下面是一种解决方案2113
1 把gitbash 的路径5261放到系统的Path环境变量里 我的是 C:\Program Files (x86)\Git\bin
2 这时4102候 你在系统命令行里就1653可以用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 ] [-c name=value]
[--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree=] [--namespace=]
[]
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 working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty Git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
'git help -a' and 'git help -g' lists available subcommands and some
concept guides. See 'git help ' or 'git help '
to read about a specific subcommand or concept.
1
>>>
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)