sách gpt4 ăn đã đi

git拒绝推送非快进

In lại 作者:IT王子 更新时间:2023-10-29 01:29:43 25 4
mua khóa gpt4 giày nike

我是 git 的新手,过去 2 个月我一直在做一个小的副项目,并且一直在毫无问题地将东西推送到 bitbucket。几天前,我压缩了我的项目文件夹(因为我必须重新安装我的 Linux 操作系统),现在在我重新安装 Linux 操作系统后将其解压缩。

所以,现在,我转到我的项目文件夹,继续愉快地工作,并最终做到了:

git add -A && git commit -m "modified code" && git push origin master

..这是我通常做的..

我得到:

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

我看过一些 SO 问题,他们建议使用强制标志 -f - 但我不确定我是否应该这样做。

p.s: 我在 master 分支上——这是我的仓库中的 chỉ một 分支。

如果有人能在这里指出我正确的方向,我将不胜感激。

Cảm ơn.

câu trả lời hay nhất

在推送之前,您必须先 pull 中央存储库中的更改。做

git add -A
git commit -m "my local changes"
git pull

解决任何冲突。 Sau đóLÀM

git push

或者,如果您在本地没有有值(value)的修改,您可以创建一个新的存储库克隆,然后从那里开始工作:

git clone https://johnsproject@bitbucket.org/johnsproject/proj.git new_repo_dir

关于git拒绝推送非快进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16899243/

25 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress