上传本地代码到GitHub远程仓库
2018-02-06 10:34
351 查看
1、在本地文件目录下,选中要提交的文件,右键点击Git Bash Here进入文件目录
2、链接远程仓库:git remote add origin git@github.com:134251796/lxy.git(远程仓库地址)
3、添加当前目录的所有文件到暂存区:git add .(点的意思是所有文件)
4、提交文件:git commit -m “描述信息”
5、上传本地分支到远程仓库:git push -u origin master
【注】如果git push报错 error:failed to push some refs to 'git@github.com:134251796/lxy.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因:
GitHub远程仓库中的README.md文件不在本地仓库中。
解决方案:
2、链接远程仓库:git remote add origin git@github.com:134251796/lxy.git(远程仓库地址)
3、添加当前目录的所有文件到暂存区:git add .(点的意思是所有文件)
4、提交文件:git commit -m “描述信息”
5、上传本地分支到远程仓库:git push -u origin master
【注】如果git push报错 error:failed to push some refs to 'git@github.com:134251796/lxy.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因:
GitHub远程仓库中的README.md文件不在本地仓库中。
解决方案:
$ git pull --rebase origin master $ git push -u origin master
相关文章推荐
- 本地代码上传到GitHub远程仓库
- 上传代码到Git远程仓库(Github)
- 使用gitbash上传代码到github远程仓库简单教程
- 如何在github上创建仓库,并将本地的文件上传到对应的远程仓库
- 如何将本地git仓库中的代码上传到github
- 把本地文件上传到远程仓库:git和github,前提是上传的不能是空文件夹
- Github上创建项目,并将本地项目上传到远程仓库的方法(使用git bash)
- (转)如何将本地git仓库中的代码上传到github
- Github建立本地仓库上传代码
- github—本地建立与远端仓库的联系以及代码上传与合并
- 【编程初学者】创建自己的开源项目4-将本地代码仓库的代码提交到远程代码仓库(myeclipse + github)
- git上传本地代码到远程仓库
- git本地项目代码上传至码云远程仓库总结【转】
- 【编程初学者】创建自己的开源项目3-将远程代码仓库下载,并创建本地代码仓库(myeclipse + github)
- 如何将本地git仓库中的代码上传到github
- 本地代码提交到Git@OSC、github或其他远程仓库的方法
- 使用命令创建github代码仓库,push本地仓库到github远程代码仓库
- Ubuntu下本地仓库项目上传至github远程仓库
- 【git】:将本地代码提交到github远程仓库的简单命令行
- 怎么用git bash上传本地项目代码到您的github仓库1