【问题标题】:Open git file with specific branch on Github from terminal从终端在 Github 上打开具有特定分支的 git 文件
【发布时间】:2017-07-15 09:36:16
【问题描述】:

假设我在本地 repo 上提交并推送.. 我想在 GitHub 上打开项目并通过一个命令显示与主分支或任何其他分支相比的文件更改,或者至少将链接复制到剪贴板,请检查:git open,但这还不够。

我在想是否可以使用 git 命令和其他一些终端技巧来创建脚本,例如:git diff HEAD~ --name-onlygit remote -v|任何附加到远程 url' 的代码?

需要的命令是:

github compareto master

github commits

github clipboard compareto master

【问题讨论】:

标签: git bash github terminal git-bash


【解决方案1】:

好吧,不要重新发明轮子。我发现 git-open 处理了很多东西,所以我分叉了它并添加了你想要的功能。 Here's my fork.

您现在可以说git open compareto <branch_name>,它会将当前分支与您提供的分支进行比较。

或者只是git open compareto而不提供分支。如果您在任何分支上并且想与 master 进行比较。

【讨论】:

    猜你喜欢
    • 2019-01-17
    • 2011-01-03
    • 2018-12-03
    • 2018-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-09
    • 2011-03-24
    相关资源
    最近更新 更多