多個(gè)git賬戶的設(shè)置
ssh-gen倒不用多說,多個(gè)賬戶的關(guān)鍵是要新增個(gè)文件:
cd ~/.ssh
touch ssh_config
注意,WIN下文件名是config
內(nèi)容大概是這樣的格式:
HOST:A.com
User:demo1
IdentifyFile: ~/.ssh/demo1_rsa
HOST:B.com
User:demo2
IdentifyFile: ~/.ssh/demo2_rsa
刪除HOST緩存,重試:
rm known_hosts
xcode與git
- github上先新建項(xiàng)目A,注意先不要初始化
- 使用xcode新建項(xiàng)目,注意要勾選使用本地GIT
- 命令行下初始化一下,不然IDE上配置容易出錯(cuò)
cd 項(xiàng)目文件夾
git remote add origin git@github.com:XX/A.git[項(xiàng)目地址]
git pull -u origin master[從網(wǎng)址拉取項(xiàng)目]
git push -u origin master[向網(wǎng)站提交項(xiàng)目]