Skip to content

shuhei-fujita/github-remote-file-opener

Repository files navigation

github-remote-file-opener

  • github-remote-file-opener は、ローカルのGitリポジトリにある特定のファイルやディレクトリを、GitHub上のURLで開くためのコマンドラインツールです。
  • このスクリプトは、現在のブランチの最新のコミットに基づいてURLを生成します。
  • ファイルがsubmodule内にある場合も対応しています。

インストール

ソースコードのクローン

まず、このリポジトリをクローンします。

git clone git@github.com:shuhei-fujita/github-remote-file-opener.git
cd github-remote-file-opener

Makefileを使用したインストール

  • このリポジトリには Makefile が含まれており、簡単なインストールが可能です。
  • このコマンドは、github-repo-open-file.sh スクリプトに実行権限を付与し、~/bin ディレクトリにコピーします。

~/binがPATH環境変数に含まれていることを確認してください。 ※ そうでない場合は、.bashrc.zshrc などのシェル設定ファイルにexport PATH=$PATH:~/binを追加してください。

make install

使い方

基本的な使い方は以下の通りです。

github-repo-open-file [相対ファイルパス]

例) 現在のリポジトリのルートディレクトリで以下のコマンドを実行すると、対応するGitHubのURLがブラウザで開きます。

github-repo-open-file ./github-repo-open-file.sh
github-repo-open-file ./README.md
github-repo-open-file ./index.html
github-repo-open-file ./src/index.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published