无法在git上上传

时间:2018-07-10 06:18:06

标签: git push commit

我已经在本地存储库中进行了更改,当我将更改推送到github时,它向我显示了该怎么办?

Updates were rejected because the remote contains work that you do hint i got from ubuntu: not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes(e.g., 'git pull ...') before pushing again. See the 'Note about fast-forwards' in 'git push --help' for details.

PS:我是git新手。

1 个答案:

答案 0 :(得分:1)

在推动我们的变化之前;从存储库中拉出。依次执行命令集。

git stash; // will dump ur changes.

git pull origin branch_name; // If pulling from same branch git pull is enough.

git stash pop; // the dumped changes in the first step will be retrieved.

git push;