我正在尝试将我的Rails项目推送到Heroku,但是Git现在不允许我做任何事情。 这是我到目前为止所做的:
git push heroku失败了,因为heroku分支在我的本地分支“前面”,这是不可能的。 我拉了,与.idea/workspace.xml发生了冲突。 我无法找出那个文件是什么,但它很大,Git写了各种各样的乱码。 手动“解决”冲突太多了。 我看到一些stackoverflow帖子谈论git忽略该文件(也许它是RubyMine的一些IDE文件或什么?),所以我试图移走文件以避免冲突 我跑了git add -A (也试过git add .和git add ) git commit --amend失败,因为“你正处于合并的中间” git merge --abort失败,因为“未跟踪的工作树文件'.idea / workspace.xml'将被合并覆盖(尽管文件已被移动) git reset --merge因同样的原因失败了。我怎样才能让Git再次工作?
I'm trying to push my Rails project to Heroku, but Git isn't allowing me to do anything at the moment. Here's what I've done so far:
git push heroku failed because the heroku branch was "ahead" of my local branch, which should not have been possible. I pulled and there was a conflict with .idea/workspace.xml. I wasn't able to find out what that file is, but it's huge and Git wrote all kinds of garble to it. Too much to manually "resolve" conflicts. I saw some stackoverflow posts talking about git-ignoring that file (maybe it's some IDE file for RubyMine or something?), so I tried to move the file away to avoid the conflict I ran git add -A (also tried git add . and git add) git commit --amend fails because "You are in the middle of a merge" git merge --abort fails because "Untracked working tree file '.idea/workspace.xml' would be overwritten by merge (despite the fact that the file has been moved) git reset --merge fails for the same reason.How can I make Git work again?
最满意答案
.idea / workspace.xml
此文件是您的想法工作区文件。 它们由IntelliJ工具生成。
我看到一些stackoverflow帖子谈论git忽略该文件(也许它是RubyMine的一些IDE文件或什么?),所以我试图移走文件以避免冲突
只需将文件夹添加到.gitignore但由于已经提交,您必须将其从存储库中删除:
# Quit the merge git merge --abort # remove the whole folder from the repo git rm -rf --cached .idea/ # add it to the .gitignore: idea/ # add and commit your changes git add .- A git commit -m " Removed idea folder" git push origin <branch>如果你仍然无法做到?
首先将代码重置为先前的状态,然后再次执行上述代码。 重置将带您到拉动之前的最后一次提交
.idea/workspace.xml
This file is your idea workspace files. They are generated by IntelliJ tools.
I saw some stackoverflow posts talking about git-ignoring that file (maybe it's some IDE file for RubyMine or something?), so I tried to move the file away to avoid the conflict
Simply add the folder to your .gitignore but since its already committed you will have to remove it from the repository:
# Quit the merge git merge --abort # remove the whole folder from the repo git rm -rf --cached .idea/ # add it to the .gitignore: idea/ # add and commit your changes git add .- A git commit -m " Removed idea folder" git push origin <branch>If you still unable to do it?
First reset the code to the previous state and then do the above code again. The reset will take you to your last commit before the pull
Git与workspace.xml合并冲突(Git merge conflict with workspace.xml)我正在尝试将我的Rails项目推送到Heroku,但是Git现在不允许我做任何事情。 这是我到目前为止所做的:
git push heroku失败了,因为heroku分支在我的本地分支“前面”,这是不可能的。 我拉了,与.idea/workspace.xml发生了冲突。 我无法找出那个文件是什么,但它很大,Git写了各种各样的乱码。 手动“解决”冲突太多了。 我看到一些stackoverflow帖子谈论git忽略该文件(也许它是RubyMine的一些IDE文件或什么?),所以我试图移走文件以避免冲突 我跑了git add -A (也试过git add .和git add ) git commit --amend失败,因为“你正处于合并的中间” git merge --abort失败,因为“未跟踪的工作树文件'.idea / workspace.xml'将被合并覆盖(尽管文件已被移动) git reset --merge因同样的原因失败了。我怎样才能让Git再次工作?
I'm trying to push my Rails project to Heroku, but Git isn't allowing me to do anything at the moment. Here's what I've done so far:
git push heroku failed because the heroku branch was "ahead" of my local branch, which should not have been possible. I pulled and there was a conflict with .idea/workspace.xml. I wasn't able to find out what that file is, but it's huge and Git wrote all kinds of garble to it. Too much to manually "resolve" conflicts. I saw some stackoverflow posts talking about git-ignoring that file (maybe it's some IDE file for RubyMine or something?), so I tried to move the file away to avoid the conflict I ran git add -A (also tried git add . and git add) git commit --amend fails because "You are in the middle of a merge" git merge --abort fails because "Untracked working tree file '.idea/workspace.xml' would be overwritten by merge (despite the fact that the file has been moved) git reset --merge fails for the same reason.How can I make Git work again?
最满意答案
.idea / workspace.xml
此文件是您的想法工作区文件。 它们由IntelliJ工具生成。
我看到一些stackoverflow帖子谈论git忽略该文件(也许它是RubyMine的一些IDE文件或什么?),所以我试图移走文件以避免冲突
只需将文件夹添加到.gitignore但由于已经提交,您必须将其从存储库中删除:
# Quit the merge git merge --abort # remove the whole folder from the repo git rm -rf --cached .idea/ # add it to the .gitignore: idea/ # add and commit your changes git add .- A git commit -m " Removed idea folder" git push origin <branch>如果你仍然无法做到?
首先将代码重置为先前的状态,然后再次执行上述代码。 重置将带您到拉动之前的最后一次提交
.idea/workspace.xml
This file is your idea workspace files. They are generated by IntelliJ tools.
I saw some stackoverflow posts talking about git-ignoring that file (maybe it's some IDE file for RubyMine or something?), so I tried to move the file away to avoid the conflict
Simply add the folder to your .gitignore but since its already committed you will have to remove it from the repository:
# Quit the merge git merge --abort # remove the whole folder from the repo git rm -rf --cached .idea/ # add it to the .gitignore: idea/ # add and commit your changes git add .- A git commit -m " Removed idea folder" git push origin <branch>If you still unable to do it?
First reset the code to the previous state and then do the above code again. The reset will take you to your last commit before the pull
发布评论