本地项目要提交到 gitee上托管,从本地仓库连接到远程仓库

1.登录gitee 建立仓库

2.上传本地仓库

3.输入提交命令

 git push

如有:

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

4.再输入

 git push origin master

如有以下报错

To https://gitee.com/mnmy/src.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/***/***.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

就是本地仓库还没提交完全,在此查看状态

git status

按照提示执行

git add .

或者

git commit

最后再次输入提交远程代码

git push origin master

结果如下:

Enumerating objects: 44, done.
Counting objects: 100% (44/44), done.
Delta compression using up to 2 threads
Compressing objects: 100% (36/36), done.
Writing objects: 100% (42/42), 93.44 KiB | 4.06 MiB/s, done.
Total 42 (delta 9), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-5.0]
To https://gitee.com/***/***.git
   c3ecf68..75b7c04  master -> master


最后告诉你,你提交成功了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值