V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
sox
V2EX  ›  分享创造

又一个轮子: 在终端打开你的 GitHub 项目主页

  •  
  •   sox ·
    egoist · 2015-11-06 17:04:03 +08:00 · 4103 次点击
    这是一个创建于 3092 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如果你现在在一个项目目录下,不用再手动切换到浏览器打开这个项目在 GitHub 的主页

    只需要召唤 ogh 就行了, a.k.a. Open GitHub

    ➜  ~  npm install -g ogh
    # in your project root, type `ogh` and press `Enter`
    ➜  localdb git:(master) ogh
    # then your default browser
    # will open `https://github.com/egoist/localdb` for you
    

    GitHub: https://github.com/egoist/ogh

    21 条回复    2015-11-07 16:10:53 +08:00
    gilgamesh
        1
    gilgamesh  
       2015-11-06 17:13:06 +08:00
    有楼主的地方就有光,不,就有我。
    riaqn
        2
    riaqn  
       2015-11-06 17:40:47 +08:00 via iPhone
    这不是一句 bash 么…
    sox
        3
    sox  
    OP
       2015-11-06 17:55:16 +08:00
    @riaqn 求瞻仰
    lukertty
        4
    lukertty  
       2015-11-06 18:06:14 +08:00
    比如这样
    ```
    open -a Google\ Chrome https://github.com/egoist/localdb
    ```
    或者
    ```
    open https://github.com/egoist/localdb
    ```
    caoyue
        5
    caoyue  
       2015-11-06 18:06:57 +08:00
    alias ogh="open https://github.$(git config remote.origin.url | cut -f2 -d.)"
    FrankFang128
        6
    FrankFang128  
       2015-11-06 18:08:24 +08:00 via Android
    。。。
    sox
        7
    sox  
    OP
       2015-11-06 18:11:10 +08:00
    @lukertty

    并不一定知道用户名项目名 233 而且如果你愿意 直接打 URL...
    sox
        8
    sox  
    OP
       2015-11-06 18:13:22 +08:00
    @caoyue not enough 233..
    sox
        9
    sox  
    OP
       2015-11-06 18:20:32 +08:00
    「那么多前端测试工具, mocha 啊 chai 啊 ava 啊都是一坨屎,还不如我 console.log 」😂
    SourceMan
        10
    SourceMan  
       2015-11-06 18:42:02 +08:00 via Android
    感谢楼主
    Hysteria
        11
    Hysteria  
       2015-11-06 19:29:02 +08:00
    @sox 确实是呢,感觉有这个需求!好工具!赞!
    sunjourney
        12
    sunjourney  
       2015-11-06 20:32:30 +08:00
    @caoyue 秒了 lz 了
    sox
        13
    sox  
    OP
       2015-11-06 20:43:56 +08:00
    @sunjourney that won't work
    oa414
        14
    oa414  
       2015-11-06 20:46:29 +08:00   ❤️ 1
    github 的 hub 命令行工具可以一键创建仓库设置 origin url 还有 用 hub browse 打开浏览器并转到项目的 github 页面
    oa414
        15
    oa414  
       2015-11-06 20:47:20 +08:00
    riaqn
        16
    riaqn  
       2015-11-06 23:21:26 +08:00 via iPhone
    git remote -v | sed -nr '0,/github\.com.*\(fetch\)/s/^origin\s(.+)\.git\s+\(.*\)/\1/p'
    貌似可行
    jsthon
        17
    jsthon  
       2015-11-07 01:05:51 +08:00 via Android
    我依然是你的脑残粉
    zhangxiao
        18
    zhangxiao  
       2015-11-07 06:49:14 +08:00
    coding 环境都是在 vagrant 里,不太用的上。赞一个吧
    zhangxiao
        19
    zhangxiao  
       2015-11-07 06:50:18 +08:00
    其实看标题我第一反应是在终端渲染我的 GH 主页,激动了一下 - -
    crayygy
        20
    crayygy  
       2015-11-07 13:54:04 +08:00
    一个 alias 不就解决了么...
    sox
        21
    sox  
    OP
       2015-11-07 16:10:53 +08:00
    @crayygy 你肯定没看楼上们
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5467 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 06:54 · PVG 14:54 · LAX 23:54 · JFK 02:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.