首页 > 其他 > 详细

git远程仓库的使用

时间:2021-01-31 00:42:40      阅读:40      评论:0      收藏:0      [点我收藏+]

简易的命令行入门教程:

注意:git上传文件push时,不能上传超个100M的单个大文件(码云和github有限制)

 

 

Git 全局设置:

git config --global user.name "xxx"
git config --global user.email "xxxx"

 

创建 git 仓库:

mkdir jz0001
cd jz0001
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/xxx/xxx.git
git push -u origin master

 

已有仓库?

cd existing_git_repo
git remote add origin https://gitee.com/xxx/xxx.git
git push -u origin master

 

 

 

 

 

 

 

二、如果报错

  1、报错如下:

error: failed to push some refs to https://gitee.com/xxx/xxx.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.

  

  解决办法:亲测有效,借鉴博客:https://blog.csdn.net/zhao_xin_peng/article/details/79378895

git pull --rebase origin master


此时再执行语句 git push -u origin master即可完成代码上传到oschina

技术分享图片

 

 

 

 

 

 

 

 

 

 

 

 

。。。

git远程仓库的使用

原文:https://www.cnblogs.com/spll/p/14351033.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!