以github做範例
* Generating a new SSH key
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
* add ssh publish key
github -> profile -> SSH and GPG keys -> New SSH key
* vim ~/.ssh/config 修改 config
```sh Host github.com HostName github.com User git IdentitiesOnly yes IdentityFile ~/.ssh/id_rsa Host github.com-abc HostName github.com User git IdentitiesOnly yes IdentityFile ~/.ssh/abc_id_rsa ```
* clone example
```sh git clone git@github.com-abc:{foo}/{bar}.git ```
# 在不同Project底下使用不同User * 進入Project底下git目錄 修改底下的user email, name
```sh git config user.email "useremail@gmail.com" git config user.name "username" ```
* 如果想修改default global user
```sh vim ~/.gitconfig ```
沒有留言:
張貼留言