LoginSignup
3
0

git-openを使って氣軽にリモートリポジトリをブラウザで開く

Last updated at Posted at 2023-12-08

皆さんは Github 等のリモートリポジトリをブラウザで開く時はどうされているでしょうか?

僕はここ最近、ターミナルからgit openコマンドを打つやり方が氣に入ってます。

(写真はgit openコマンドのREADMEから拝借)

git-open の使い方

  1. ターミナルを開き、プロジェクトのディレクトリに入っているのが前提
  2. (ブラウザでリポジトリを開きたい時に)git openと入力
terminal
cd path/to/my-app

git open

git-open のインストール方法

いくつかやり方があります。

一回きりの作業なのでgit-open作者が推奨しているように手動でコマンドファイルを作るのが一番良い氣がします。コマンドの置き場所は人それぞれ好みによります。パスが通っていることさえ確認したらどこでも構わないと思います。

Ubuntu の.profileにパスを通すのに便利ないいサンプルコードがあります。

.profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

git-open は要らないかも

さいごに

本記事は 闘魂Elixir #59 の成果です。ありがとうございます。

toukon-qiita-macbook_20230912_091808.jpg

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0