本地项目要提交到 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


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

你可能感兴趣的:(javascript)