0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Gitコマンドへのエイリアス設定

Posted at

新規PCに対して再設定をしていくので、設定方法をメモ。

Gitコマンドに対するエイリアス設定

gitをgにする。

% vi ~/.zshrc

下記を追加する。

.zshrc
alias g='git'
.zshrc
% source ~/.zshrc

確認

.zshrc
% g --version
git version 2.39.2 (Apple Git-143)

Gitコマンドのオプションへの設定

pullをpにする。

% git config --global --list
fatal: unable to read config file '/Users/${User name}/.gitconfig': No such file or directory
% git config --global alias.p pull

確認

% git config --global --list
alias.p=pull
% g p
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 37 (delta 28), reused 37 (delta 28), pack-reused 0
Unpacking objects: 100% (37/37), 9.70 KiB | 220.00 KiB/s, done.

〜 省略 〜

その他

前職のGitコマンドのエイリアス設定をエクスポートするの忘れてた…。
なにか便利なエイリアス設定があったらコメントで教えていただけると嬉しいです😅

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?