0

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 app\assets\stylesheets 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.

Jeremy Thomas
  • 6,240
  • 9
  • 47
  • 92
  • You need to learn how to resolve merge conflicts properly and what those "random" <<<< – blackbird Nov 11 '15 at 21:00
  • You can use git to go back to a point before your disastrous merge. The scss is never served, did you forget to compile the scss to css ? – blackbird Nov 11 '15 at 21:02

1 Answers1

1

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.

Community
  • 1
  • 1
ktravers
  • 341
  • 5
  • 17