如何从Linux上的终端将我的工作推送到Github上的存储库?

时间:2016-08-05 15:05:45

标签: linux git github git-push

我正在尝试将我在本地驱动器上的工作上传到我分叉的Github存储库。这是我输入终端的代码:

cd Desktop
cd <project>
ls
git init
git add .
git commit -m "first commit"
git log
git remote add publicrepot <github link>
git remote publicrepo
git push -u publicrepo
git push --set-upstream publicrepo master

然后它给了我这个消息:

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.

如何将我的工作上传到我从其他帐户分配的存储库?

1 个答案:

答案 0 :(得分:2)

在将更改推送到遥控器之前,您必须拥有遥控器所具有的所有更改(除非您是强制推动,您可能不应该这样做)。尝试运行

"where images.type = 1"
在你推动之前

或者,如果您不想进行合并提交,

git pull