GitHub と GitLab で Git config を切り替えたい
設定方法
ディレクトリごとに読み込む設定ファイルを分岐させます。
/Users/iris/Documents/repos/
├── github.com
└── gitlab.com
github.com
以下には GitHub のリポジトリ、gitlab.com
以下には GitLab のリポジトリが配置されている状態です。
gitlab.com
以下にいる時だけ ~/.dotfiles/git/gitconfig.gitlab
を読み込むようにして user.email
を GitLab に登録した Email で上書きします。
.gitconfig
[user]
name = peaceiris
email = [email protected]
[includeIf "gitdir:~/Documents/repos/gitlab.com/"]
path = ~/.dotfiles/git/gitconfig.gitlab
~/.dotfiles/git/gitconfig.gitlab
[user]
email = [email protected]
includeIf
について
以下を参照した。
Author And Source
この問題について(GitHub と GitLab で Git config を切り替えたい), 我々は、より多くの情報をここで見つけました https://qiita.com/peaceiris/items/a9cbac0765ffd148ed27著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .