初识 git 上传代码到github 掉坑里了哦
2016-10-15 20:23
351 查看
想把暑假没做完的地铁网络售票系统上传到github 本以为花个几分钟就好了 没想到弄了那么长时间 实在是不应该啊 下面说说我的遭遇
上传代码到github方法:
①用github的客户端(GUI 易操作 )
②用git上传
也是在git上传时候遇到的坑
步骤:
详细步骤:http://blog.csdn.net/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
详细解答:http://blog.csdn.net/fanfan4569/article/details/52824975
有待学习。。。
命令行:
$ git remote show origin 查看某个远程仓库的详细信息
$ git remote rm origin 删除远程仓库地址
$ git remote add origin [url] 添加远程仓库地址
相关文章推荐
- 【FIRST USE】第一次用git把代码上传到github
- 如何使用Git上传项目代码到github
- 如何使用Git上传项目代码到github
- eclipse下使用git上传(下载)代码至(从)github
- git使用之如何将github库下载到本地与如何将代码上传github
- 如何使用Git上传项目代码到github
- 初识Git,如何利用Git将代码托管到GitHub上
- 如何使用Git上传项目代码到github
- 使用Git上传项目代码到github
- 如何使用Git上传项目代码到github
- Github:在eclipse中使用git clone 别人共享在Github的代码和上传到自己的仓库!
- git学习——上传项目代码到github
- git使用之如何将github库下载到本地与如何将代码上传github
- git使用之如何将github库下载到本地与如何将代码上传github
- git学习——上传项目代码到github
- 【eclipse下使用git上传(下载)代码至(从)github】
- git使用之如何将github库下载到本地与如何将代码上传github
- 【转载】如何使用Git上传项目代码到github
- 使用Git(msysgit)和TortoiseGit上传代码到GitHub
- 使用Git上传本地项目代码到github