LoginSignup
1
0

More than 5 years have passed since last update.

brewでGitressをインストールする方法とglコマンドが使えない問題の解決策

Posted at

はじめに

Gitlessはgitの仕組みを簡単にするために作られたCUIツールです。

詳しくはGitless公式サイト(英語)または、gitをシンプルでわかりやすくするツールGitlessの紹介[和訳]をご覧ください。

Gitlessのインストール方法はいくつかあるのですが、今回はHomebrewを利用してインストールします。
また、zshを使っている人はglコマンドが正しく実行できない可能性があるので、その場合はこちらをご覧ください。

環境

  • macOS Sierra 10.12.3
  • Homebrew 1.1.10
  • zsh 5.2 (x86_64-apple-darwin15.2.0)

インストール方法

  1. Homebrewを更新して、formulaを最新版にする。*1
    $ brew update

  2. Gitlessをインストールする。
    $ brew install gitless

  3. インストール完了!

*1 Error: The /usr/local directory is not writable.と出て、アップデートできない場合、brew update: /usr/local 権限周りの問題=更新で解消を参考にしてください。

gl initができない!

問題

さっそくGitlessの練習用のフォルダを作り、gl initでリポジトリを作成しようとしたところ、次のエラーが発生しました。

zsh
$ gl init
fatal: Not a git repository (or any of the parent directories): .git

今からリポジトリを作るのに、"リポジトリ(.git)がない!"と怒られました。

原因

しょうがないのでhelpを見ようと思いgl -hを実行したところ、次のメッセージがでました。

zsh
$ gl -h
usage: git pull [<options>] [<repository> [<refspec>...]]
.
.
.

どうやらglgit pullを略したaliasとなっていたみたいですが、私は身に覚えがありません。
調べたところ、zshが標準で設定していたみたいです。

170 alias gl='git pull'
git.plugin.zshより引用

解決策

.zshrcにaliasを追加しましょう!

.zshrc
alias gl='gl'

もう一度gl initを実行してみます。

zsh
$ gl init
✔ Local repo created in /Users/hoge/foo

こんどこそインストール完了!

1
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
1
0