Last active
April 18, 2020 11:00
-
-
Save 1natsu172/70a741781e78d80299f283a6af4f3ba6 to your computer and use it in GitHub Desktop.
https時代のgitアカウントを使い分ける方法 ref: https://qiita.com/1natsu172/items/a4a3357a0481440ec6a5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
host github.com-main | |
HostName github.com | |
IdentityFile ~/.ssh/id_rsa_github | |
User git | |
host github.com-sub | |
HostName github.com | |
IdentityFile ~/.ssh/id_rsa_github_sub | |
User git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone [email protected]:username/repo.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git credential-osxkeychain | |
Usage: git credential-osxkeychain <get|store|erase> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://[email protected]/1natsu172/example-private-repo.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://[email protected]/1natsu172/example-private-repo.git | |
Password for 'https://[email protected]': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git remote -v | |
origin https://[email protected]/1natsu172/example-private-repo.git (fetch) | |
origin https://[email protected]/1natsu172/example-private-repo.git (push) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example -F /dev/null" git clone example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git config core.sshCommand "ssh -i ~/.ssh/id_rsa_example -F /dev/null" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git config --global user.name "Mona Lisa" | |
$ git config --global user.email "[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git config --local user.name "Mona Lisa" | |
$ git config --local user.email "[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GIT_COMMITTER_NAME="Mona Lisa" | |
export GIT_COMMITTER_EMAIL="[email protected]" | |
export GIT_AUTHOR_NAME="Mona Lisa" | |
export GIT_AUTHOR_EMAIL="[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://gitlab.com/1natsu172/example-public-repo.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://gitlab.com/1natsu172/example-private-repo.git | |
Username for 'https://gitlab.com': | |
Password for 'https://gitlab.com': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git config --global credential.helper osxkeychain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment