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中
3.建立仓库
1.初始化仓库
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
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。