2

So to make a long story short, I've been working on a web app for the past few months. Recently I had to get a new laptop and cloned the repository from github onto my new machine... However whenever I commit changes to my app and attempt to use git push -u in the app's root directory i get the following message:

To git@github.com:acc/etc.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:acc/etc.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.

but when I try git pull git@github.com:acc/etc.git master I get a message telling me that the pull was aborted.

From github.com:acc/etc * branch master -> FETCH_HEAD error: Your local changes to the following files would be overwritten by merge: config/routes.rb test/fixtures/users.yml Please, commit your changes or stash them before you can merge. Aborting

so then i commit my changes using git commit -m 'fixing' and then attempt git pull again.

however this time I got messages stating that practically all my files had an "Auto-Merging CONFLICT"

am i totally screwed with this particular repository? I'm not really sure what to do since git is still somewhat new to me....

4

2 回答 2

3

我完全搞砸了这个特定的存储库吗?

不,但是您必须进行手动合并,因为 Git 无法弄清楚。git status会告诉你哪些文件需要编辑。文件本身包含指示您应该在哪里编辑的标记。完成后,git push应该再次工作。

于 2012-06-18T18:10:48.423 回答
2

如果更改不是那么大,请考虑在项目外部的不同目录中制作整个文件夹/项目的副本,然后git reset --hard HEAD将清除、擦除和删除您最近的更改。
然后,您可以使用您的 save3d 副本再次单独应用它们以供参考。
当然,请确保您git add之前git commit
最后,如果您遇到自动提交合并问题,您总是可以手动编辑文件来解决。

于 2012-06-18T18:17:47.143 回答