首页 > 解决方案 > 通过 Git 将更改发送到云时出错

问题描述

我第一次尝试上传我的本地项目,当我执行$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

应用提示后返回错误:

Warning: Permanently added the RSA host key for IP address '---------------' to the list of known hosts.
To github.com:LuisMatheus-dev/Gama-Academy.git
  ! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com: LuisMatheus-dev / Gama-Academy.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.

我应该如何进行?

标签: gitgithub

解决方案


远程 master 包含本地 master 没有的提交。也许这个答案有帮助。


推荐阅读