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

2015-11-06 17:04:03 +08:00
 sox

如果你现在在一个项目目录下,不用再手动切换到浏览器打开这个项目在 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

4108 次点击
所在节点    分享创造
21 条回复
gilgamesh
2015-11-06 17:13:06 +08:00
有楼主的地方就有光,不,就有我。
riaqn
2015-11-06 17:40:47 +08:00
这不是一句 bash 么…
sox
2015-11-06 17:55:16 +08:00
@riaqn 求瞻仰
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
2015-11-06 18:06:57 +08:00
alias ogh="open https://github.$(git config remote.origin.url | cut -f2 -d.)"
FrankFang128
2015-11-06 18:08:24 +08:00
。。。
sox
2015-11-06 18:11:10 +08:00
@lukertty

并不一定知道用户名项目名 233 而且如果你愿意 直接打 URL...
sox
2015-11-06 18:13:22 +08:00
@caoyue not enough 233..
sox
2015-11-06 18:20:32 +08:00
「那么多前端测试工具, mocha 啊 chai 啊 ava 啊都是一坨屎,还不如我 console.log 」😂
SourceMan
2015-11-06 18:42:02 +08:00
感谢楼主
Hysteria
2015-11-06 19:29:02 +08:00
@sox 确实是呢,感觉有这个需求!好工具!赞!
sunjourney
2015-11-06 20:32:30 +08:00
@caoyue 秒了 lz 了
sox
2015-11-06 20:43:56 +08:00
@sunjourney that won't work
oa414
2015-11-06 20:46:29 +08:00
github 的 hub 命令行工具可以一键创建仓库设置 origin url 还有 用 hub browse 打开浏览器并转到项目的 github 页面
oa414
2015-11-06 20:47:20 +08:00
riaqn
2015-11-06 23:21:26 +08:00
git remote -v | sed -nr '0,/github\.com.*\(fetch\)/s/^origin\s(.+)\.git\s+\(.*\)/\1/p'
貌似可行
jsthon
2015-11-07 01:05:51 +08:00
我依然是你的脑残粉
zhangxiao
2015-11-07 06:49:14 +08:00
coding 环境都是在 vagrant 里,不太用的上。赞一个吧
zhangxiao
2015-11-07 06:50:18 +08:00
其实看标题我第一反应是在终端渲染我的 GH 主页,激动了一下 - -
crayygy
2015-11-07 13:54:04 +08:00
一个 alias 不就解决了么...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/234202

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX