git bash 安装python_python如何使用gitbash执行git命令?

2017-12-02 回答

下面是一种解决方案 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 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 <command>' or 'git help <concept>' to read about a specific subcommand or concept. 1 >>>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值