curl 操作github

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zhu126fang/article/details/49202823

1. 列出所有的库

curl -u zhu126fang https://api.github.com/user/repos | grep '"name":'

2. 查询确定的库

curl -u zhu126fang https://api.github.com/repos/zhu126fang/5ichai

3. 保存库信息后,再筛选库名

pi@raspberrypi ~ $ curl -u zhu126fang https://api.github.com/user/repos >>github.json
Enter host password for user 'zhu126fang':
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  153k  100  153k    0     0  58744      0  0:00:02  0:00:02 --:--:-- 66999
pi@raspberrypi ~ $ cat github.json | grep '"name":'
    "name": "12306",
    "name": "5ichai",
    "name": "bakingpi-www",
    "name": "Chart.js",
    "name": "Codesys",
    "name": "Demo1",
    "name": "FruityWifi",
    "name": "Hello-Word",
    "name": "jekyll-bootstrap",
    "name": "leanote",
    "name": "linux",
    "name": "mplayer_study",
    "name": "openwrt",
    "name": "os_diy",
    "name": "platform-samples",
    "name": "PyDDE",
    "name": "raspberry",
    "name": "webpy",
    "name": "zhu126fang.github.com",

4. curl创建库

pi@raspberrypi ~ $ curl -u zhu126fang -d '{"name":"Hello-Word","description":"This is our first repository"}' https://api.github.com/user/repos


阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页