1. 命令git push -u origin master时候
错误提示:failed to push some refs to
解决办法:git pull origin master//先把远程服务器github上面的文件拉先来,再push 上去。
错误提示:Couldn't find remote ref maste
错误提示:refusing to merge unrelated histories
解决办法:git pull origin master --allow-unrelated-histories//将之前的git pull origin master修改一下
2、添加步骤:
2.1:
git init
2.2:
git remote add origin git@gitee.com:liaoxuefeng/learngit.git
2.3:
git pull origin master --allow-unrelated-histories
2.4:
git push -u origin master
2.5:
git add .
2.6:
git commit -m 'first'
2.7:
git push
3、遇到需要帐号密码的,代码管理码云git设置账号密码
3.1 配置全局变量
git config --global user.name "码云用户名"
git config --global user.email "码云注册邮箱"
3.2
设置邮箱账号
git config --global user.email "you@example.com"
设置码云昵称
git config --global user.name "Your Name"