我很新的混帐,我一直在研究小方项目过去2个月,并已推到的东西用到位桶没有问题。几天以前,我拉上我的项目文件夹(因为我不得不重新安装我的Linux操作系统),现在我的Linux操作系统重新安装后解压这一点。
所以,现在,我去了我的项目文件夹,保持愉快地工作,终于做到了:
git add -A && git commit -m "modified code" && git push origin master
..这是我平时做..
我得到:
To https://[email protected]/johnsproject/proj.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://[email protected]/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.
我有看,他们建议使用力标志-f
几SO问题 - 但我不确定我是否应该这样做。
P.S:我在主分支 - 这是对我的回购协议only
分支。
真的很感激,如果有人可以点我朝着正确的方向。
谢谢。
有在中央资料库,你必须拉之前,你可以把变化。做
git add -A
git commit -m "my local changes"
git pull
解决任何冲突。然后做
git push
另外,如果你在本地没有有价值的修改,您可以创建回购新克隆,并从那里开始工作:
git clone https://[email protected]/johnsproject/proj.git new_repo_dir
试着做
git pull origin master
git add -A
git commit -m "modified code"
git push origin master
你的本地仓库很可能走出与远程存储库同步。
我有同样的问题。我固定通过使用强制更新git push -f
命令。
对我的作品git push --set-upstream origin master -f
在我的情况是从git仓库新的文件不添加,这是解决办法1. git的状态(只是为了检查)2. git的补充。 3.混帐推-u主产地
您可以尝试git的拉动,在这之后的git在工作室承诺,那混帐推起源的分支名之后。