Wednesday, February 5, 2014

Exploding Git Day 14 & 15

I added a couple of missing images that were casuing errors when rails server ran. They were fancy product design images. ajax-loader and grid. I added them and then tried to grep for where the links were to them. This is when I discovered that my master was different from the real master.

Somehow I managed to merge master with master or something, anyways my master was messed up.
The series of things Kurtis had me do to get back to the real master:
  •   574  history | grep git
  •   575  git log
  •   576  git checkout origin/master
  •   577  git fetch
  •   578  git branch -D master
  •   579  git checkout -b master
  •   581  git branch
  •   582  git checkout fancyproduct-missing-images
  •   583  git log
  •   584  git reset --soft HEAD^1
  •   585  git status
  •   586  git stash
  •   587  git checkout master
  •   588  git branch -D fancyproduct-missing-images
  •   589  git checkout -b fancyproducy-missingimages
  •   590  git stash apply
  •   591  git add .
  •   596  git status
  •   597  git add .
  •   598  git commit -m 'adds images ajaxloader grid and updates fancyproductdesigner css'
  •   599  git branch
  •   600  git push origin fancyproducy-missingimages
  •   601  history | grep git
I also made sure all the static pages were correct.


I Exploded Git again!
Arrghh.  This is what I think happened:

I was fixing a pull request to remove the changes to db/schema.rb

When I was doing the edits before I did the push I had to run $rake db:migrate so it updated the database.
When I did a   $ git add .  it added the changes to the database

Kurtis wanted me to get rid of those changes from the pull request.

In order to do this I went back to my branch and ran
  $ git reset --soft HEAD^ 
I tried to push and it kept being rejected.

I did a  $ git pull . master 
tried to push and it was still rejected so I had to force push because I rewrote the history

I did  $ git push --force 
WHICH WAS BAD! Never git force without specifying what branch name or which remote.
(The remote is origin or upstream)
This eneded up forcing all my branches to the master on github which erased all the commits that Kurtis had made too. Luckily he still had his remote branches and could re-push them. Phew. That would have been an actual disaster.

What I should have done was
 $ git push --force origin branch_name


 $ git log -p  is git log --pretty=oneline
http://gitready.com/advanced/2009/01/20/bend-logs-to-your-will.html
http://gitimmersion.com/lab_10.html

473  git reset soft HEAD^1

  474  git reset --soft HEAD^1
  477  git status
  479  git reset HEAD db/schema.rb
  480  git status
  481  git add public/beta.html
  482  git commit -m 'undid the changes to db/schema'
  483  git branch
  484  git push origin public-images
  485  git push origin public-images
  486  git checkout -- db/schema.rb
  487  git status
  488  git push origin public-images
  489  git pull . master
  490  git status
  491  git push origin public-images
  492  git pull --rebase . master
  493  git status
  494  git push origin public-images
  495  git push --help
  496  git status
  497  git log -b
  498  git log -p
  499  git branch
  500  history | grep git








Tuesday, February 4, 2014

Active Admin Gem

I am watching the RailsCast on Active Admin #284 Active Admin Sep 19, 2011 Even though it's old it's giving me the basic idea.

I uploaded photos to the admin page via Active Admin

Googling Multi-Tenancy Analytics:
http://webmasters.stackexchange.com/questions/19237/tracking-multiple-domains-and-subdomains-on-one-analytics-profile