背景:使用mac版的sourcetree上get代码,由于不能使用https只能用ssh,可是常规使用win版本的操作在mac上不好使了,总是提示上传失败,请手动添加ssh。
解决方案:使用github上token请求的方式!还是采用https。
第一步:先进入finder
cmd+shift+g
/Users/myd/Library/Application Support/SourceTree
干掉@github.com的文件,都删了。
(如果有myd改成你电脑用户名即可)
强制退出sourcetree!
第二步:
打开终端输入
git config --global credential.helper osxkeychain
vi ~/.gitconfig
输入IP:端口(科学上网端口)
ESC 后:wq
第三步