Potential Git/Rails Disaster: Web page no longer loading
I have spent a lot of time working on a webpage and have been very lazy about committing things to Git. Today, I attempted to push everything up to my repo, but I think I may have caused a disaster. I am very new to Git and basically just use it for its most basic functions.
I was unable to push
anything and the console recommended using a pull
request, after doing that and attempting to push again, I began to get a bunch of merge conflicts with my gemfile
and gemfile.lock
. I tried fixing this issue as well but then I started seeing random <<<<<<HEAD
throughout my files (including routes
as well as my javascript).
Now when I try to load my localhost page, I seem to have all my content, but my css file will not load resulting in a very ugly page. When I use chrome devtools and try to look at the sources, the application.css.scss
is blank, when mine have 1000+ lines of code (and is viewable in the appassetsstylesheets
folder.
Has anyone had something like this happen / know how to remedy the amount of damage I might've done in 15 min. Anything will help as I do not know how to proceed.
you'll want to try doing a git reset --hard
to reset your local repo to the state it was at before you ran git pull
.
see this answer for reference: https://stackoverflow.com/a/1223385/3880374
also, in case you're curious about those "random" <<<<<<HEAD
strings throughout your files, those are actually added by Git. Per their docs:
Git adds standard conflict-resolution markers to the files that have conflicts, so you can open them manually and resolve those conflicts
Github also has a helpful guide to resolving these conflicts via the command line.
链接地址: http://www.djcxy.com/p/94794.html上一篇: 如何在合并和提交后恢复git更改