1

I am baffled. I made a branch to make css changes to my Ruby on Rails app. Let's call the branch Update_CSSAfter I made changes, I did git statusand it showed that the css files were not added so I added them with git add app/assets/stylesheets/application.cssThen I committed my changes with git commit -am "Updated CSS". Then I checked out master and merged branch with CSS changes:

git checkout Master
git merge Update_CSS

Terminal said changes were merged, blah blah. Then tried to push to git: git push. Then I got the following message Everything up-to-date! What?! Sure enough, I looked on Github and the the CSS file was different from the one on my machine. I actually have a couple of CSS files that are merged and committed on my machine and not on origin/master. Any idea what's going on or how to fix this. Ideally, I'd like to override the file in origin/master with the one on my local master.

Update: When I ran git checkout master with a small "m", the output read: Your branch is ahead of 'origin/master' by 9 commits. I wonder if I was careless with the capitalization of "master" and that somehow screwed things up. I tried changing other files on Master, committing changes, and pushing to git, and now I always get that Everything up-to-date.

isergio
  • 23
  • 1
  • 5
  • 1
    As an ad hoc solution when I have encountered a similiar problem problem I make a meaningless change to code, say adding a blank line to controller, and then commit and push. Also if pushing to Heroku you need to "rake assets:clobber" and "rake assets:precompile RAILS_ENV=production --trace" first before pushing. – user1854802 Apr 10 '14 at 01:38
  • what does a "git log --graph" tell you? – chris polzer Apr 10 '14 at 13:17
  • This might not be super accurate since I've tried a couple of other things, but the output to git log --graph was:`16:44:16-sergio~/Desktop/Code/atma (Master)$ git log --graph * commit bb18dd6df6507b2bbd511baf68e1373a25d262f3 | Author: Sergio Paluch | Date: Wed Apr 9 16:33:04 2014 -0700 | | Got rid of junk in application.css | * commit 2b85367175198f4934ee48b0028cfb18be45110e |\ Merge: e3e129f 422facc | | Author: Sergio Paluch | | Date: Wed Apr 9 16:29:51 2014 -0700 | | | | Merge branch 'Make_Span_Viewport' into Master` – isergio Apr 10 '14 at 18:19
  • cont..`| * commit 422facce779e36828db9b073f563816dab4f4788 | | Author: Sergio Paluch | | Date: Wed Apr 9 16:29:04 2014 -0700 | | | | Got rid of junk in application.css | | * | commit e3e129f9be38325d8e864c2ef553f034107293c7 |/ Author: Sergio Paluch | Date: Wed Apr 9 16:22:16 2014 -0700 |` – isergio Apr 10 '14 at 18:20
  • 1
    Thanks for the suggestion, Chris! I actually tried making a meaningless edit to commit again. Basically, followed the same workflow as before. All the commits went through fine on my machine, but when I tried to push to origin/master I keep getting "Everything up-to-date". I didn't know about the `rake assets:precompile` for Heroku, so thanks for that!! – isergio Apr 10 '14 at 18:22

1 Answers1

0

I'm not really quite sure how it happened, but when I checked out master to merge my branch, I typed "Master" with a capital m. Rather than merging with master, I merged with Master. My solution was to make the updated to master and reset my local branch with git reset --hard origin/master as per this thread

I'd love to hear what actually happened here in detail because I'm not sure I fully get it. Thanks!

Community
  • 1
  • 1
isergio
  • 23
  • 1
  • 5