1

I'm having a problem reseting my app to a previous commit. I'm trying out bootstrap for the first time and when I tried to modify bootstrap_and_overrides.css.less I broke something and the styling was all over the place.

I had no problem completely discarding the changes and had a commit on my local machine that was not pushed and where the code was working perfectly so I used

git reset --hard 0f0503e......

to reset my local repository. I got the message

HEAD is now at 'commit message'

but the styling is still broken. I then tried to go back one further. Again I got the message that the branch has been reset but my styling is all over the place. I'm now at a stage where I've reset to my last published commit and being very new to git/bootstrap and a beginner with ruby on rails - I'm really not sure how to fix this.

Have I broken something by reseting my repository? Or is this a bootstrap problem?

SoSimple
  • 701
  • 9
  • 30
  • local and production environment don't act the same always , ders a command for it rails s -e production which tries to replicate what could possibly go wrong wen the app is on live . – Caffeine Coder Apr 29 '14 at 10:35
  • @CaffeineCoder Sorry if I was unclear, I'm not in production. I'm working solely in development. – SoSimple Apr 29 '14 at 10:36

1 Answers1

0

Make sure you don't have private (not versioned) files laying around, which could produce some side-effect explaining the broken CSS.

Check if you have such files:

git clean -d -x -n

(It previews what would be cleaned)

Then remove everything:

git clean -d -x -f

(As mentioned in "How do I clear my local working directory in git?")

The resulting (cleaned) working-tree would then be truly equals to 0f0503e (the commit you git reset --hard to).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • There were a couple of files and I've removed them and restarted my server but my styling is still all over the place. – SoSimple Apr 29 '14 at 10:41
  • Maybe you have some old precompiled assets in public? – zrl3dx Apr 29 '14 at 10:50
  • @zrl3dx the public folder just has systems and uploads subfolder so I don't think so. Unless I'm checking incorrectly? – SoSimple Apr 29 '14 at 10:56
  • @SoSimple, we'll try to spot the snippet making things falling appart. Can you display the ten last entries of your reflog. (git reflog -10) Then find the reference when all was good. Let say HEAD@{3}. Then do a "git diff HEAD@{3}..HEAD{0}" . I suppose that HEAD@{0} is the HEAD position after the reset --hard you've mentionned. What have you got with this ? – chaiyachaiya Apr 29 '14 at 11:55
  • @chaiyachaiya I get quite a long printout, it seems to be uncommited changes to the gemfile that I've been making over the past hour or so because I think bootstraps acting up. I've just changed the version and started redoing my styling. – SoSimple Apr 29 '14 at 12:17