Am I caught in a push-pull catch-22? #536
-
I pushed a draft of Practical 2-1 onto my repository at the end of class on Monday, intending to edit it and push the edit. It took a long time for the initial push to commit, which seemed to be because I had accidentally included the html report along with the R code. So, I went into the repository and manually deleted the html file. I then went and finished Practical 2-1, hit commit, and then tried to push it. Which gives me this error message:
However, if I do try to pull first, it quite sensibly warns me that my edits to finish the practical would be overwritten, and aborts the merge:
I would like to "See the 'Note about fast-forwards' in 'git push --help' for details." but I'm not sure which 'help' repository to look in. Can any humans help me, please? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Wait, just remembered I did manage to edit my code in a more basic way earlier (just as a test), and that pushed fine. So now it is even more mysterious! |
Beta Was this translation helpful? Give feedback.
-
Wait wait a second time, I went back and checked, and I deleted the apparently rogue html file after pushing those first superficial edits. So I expect that deletion is the problem. But how can I get out of it? |
Beta Was this translation helpful? Give feedback.
-
@mhuzzell Sorry for the delay in getting back to you. This is a classic problem with git, and for future reference really never, ever edit your code on GitHub (it sounds like this is where you first deleted the file). It causes all sorts of problems that even experienced git users try really hard not to get involved with. However, it may not be that hard to fix... in person it'll almost definitely be easy, but here's something to try anyway. You should either see the html file in the git tab with either a You may see some other files with and then yes. The file should disappear from the git tab, to say it has gone back to how it was before. You should now be able to "pull" the deletion from GitHub, and the file should disappear, and then you'll be able to commit and push your changes back... try that and see how it goes anyway... |
Beta Was this translation helpful? Give feedback.
-
Resolved in class -- thank you for your help! |
Beta Was this translation helpful? Give feedback.
Resolved in class -- thank you for your help!