Cheatsheet for viewing commits/branches in git

A couple notes on different log flags that I use for a couple applications

Only shows commits that are referred to by current state of branch
git log --graph --all --decorate --simplify-by-decoration

Shows all commits from all branches in a tree
git log --graph --all --decorate

A few notes on reading a branch.

If you are confronted with something like the following:


* commit 4589a323c3eddc4f488ea856c49db86d76bfe65f (Branch_5)
| Author: Neanderslob <neanderslob@neanderslob.com>
| Date: Tue Apr 14 01:52:17 2015 -0600
|
| Commit 5
|
| * commit d168ac4d7ab7e80c85d0630dc00a67319293f6a7 (Branch_4)
| | Author: Neanderslob <neanderslob@neanderslob.com>
| | Date: Tue Apr 28 15:01:00 2015 -0600
| |
| | Commit 4
| |
| * commit 06a6299ede5a1d6abf562b3a4999d6b6905dae80 (Branch_3/Branch_4)
|/ Author: Neanderslob <neanderslob@neanderslob.com>
| Date: Fri Apr 24 15:24:08 2015 -0600
|
| Commit 3
|
* commit 2118bcb9d2c5fae313841fa66a5af6294cf8ba31 (Branch_2)
| Author: Neanderslob <neanderslob@neanderslob.com>
| Date: Sat Apr 4 02:49:06 2015 -0600
|
| Commit 2
|
* commit 413697b0fbd36552613c51634080b419bf8ed6e9 (Branch_1)
| Author: Neanderslob <neanderslob@neanderslob.com>
| Date: Fri Mar 20 17:24:27 2015 -0600
|
| Commit 1

The way you read it is:

  • Branch_2 comes off of Branch_1.
  • Branch_3 and Branch_4 came off of branch 2 at the same point
    • Branch_4 is ahead of Branch_3
  • Branch_5 came off of Branch_2 as well but after 3&4 did
Advertisement
Cheatsheet for viewing commits/branches in git

Notes: Adding themes to rails app

To add themes to a rails app

  • Drop respective css and javascript files into appropriate directory under vendor/assets/.
    Note: Files should have unique name (I name them after the theme so flatty-theme/css/style.css simply becomes flatty.css.
  • Add the following code to your config/application.rb under # add custom validators path in the Application class

    config.assets.paths << "#{Rails.root}/vendor/assets/*"
    config.assets.paths << "#{Rails.root}/vendor/assets/fonts"
    config.assets.paths << "#{Rails.root}/vendor/assets/stylesheets"
  • Adjust whatever views you’re using to use the appropriate classes in your theme

…And that’s it!

Notes: Adding themes to rails app

How to Override and Customize the Devise Controller in Rails

Was an absolute lifesaver when I was trying to add additional registration information to my sign-up page.

How I Learned Ruby on Rails

Judging by the number of different StackOverflow questions, there are a lot of people trying to do this, and a lot of confusion. Here is how I did it, and hopefully it helps you.

I have a User and a Verifier model.  What I want to do is create a new Verifier every time I create a new user, and pass in the user.id for the User into the verifier.user_id so that they are mapped together.

In order to do this I want to not really override but add additional functionality to the existing devise controller that handles when new users are created (and destroyed).  So I need to access the RegistrationsController#Create function in devise.

First thing is to create a new folder in the ‘app/controllers‘ folder where we can put my custom controller.  I called mine ‘app/controllers/my_devise‘.  Then create a new file in this folder…

View original post 534 more words

How to Override and Customize the Devise Controller in Rails