想把暑假没做完的地铁网络售票系统上传到github 本以为花个几分钟就好了 没想到弄了那么长时间 实在是不应该啊 下面说说我的遭遇
上传代码到github方法:
①用github的客户端(GUI 易操作 )
②用git上传
也是在git上传时候遇到的坑
步骤:
详细步骤:http://blog.youkuaiyun.com/fanfan4569/article/details/52824800
$ git init
$ ssh-keygen -t rsa -C “your_email@youremail.com”
$ ssh -T git@github.com
$ git config –global user.name “your name”
$ git config –global user.email “your_email@youremail.com”
$ git remote add origin git@github.com:yourName/yourRepo.git
$ git add XXX
$ git commit -m “first commit”
$ git push origin master
遭遇点①:
error:[git] warning: LF will be replaced by CRLF
解决办法:
在git bash 输入下面的命令:
git config –global core.autocrlf false(2个’-‘)
删掉项目中的.git文件夹 $ rm -rf .git
重新
git init 再 git add XXX
遭遇点②:
由于我多次push 又 remove git 又 新建 导致版本更新不同(。。。
error : updates were rejected because the tip of your current branch is behind its remote counterpart
然后我找了很多 但都不行 最后强制push
$ git push -u origin master