Git首次配置远程仓库
码农天地 -1.配置全局用户名和邮箱git config --global user.name "shanyouyan"git config --global user.email "xxx@qq.com"2.配置密钥ssh-keygen -t rsa -C "shanyouyan@outlook.com"cat ~/.ssh/id_rsa.pub
将得到的密钥配置到远程仓库的SSH Keys中
1.git init
2.放入暂存区并提交到本地1.git add . (表示暂存所有文件)
2.git add 某个文件名称
如果出现:warning: LF will be replaced by CRLF in 'xxx' 错误时,原因是因为Windows和Linux提交时的换行符不一样,解决方法:
git config --global core.autocwenrlf false
3.
git commit -m"第一次提交"
git remote add origin git@github.com:shanyouyan/shopMall.git
4.
git push (-u) origin master
如果出现身份验证的错误,fatal: Authentication failed for 'http://xxx/'
使用命令:git push --set-upstream origin master
5.git配置记住用户名和密码:
git config --global credential.helper store
特别申明:本文内容来源网络,版权归原作者所有,如有侵权请立即与我们联系(cy198701067573@163.com),我们将及时处理。
上一篇: Git常见错误及解决办法收集