Archive

Archive for the ‘Git’ Category

Tip – use github to “steal” code

January 14th, 2011 Comments off

One trick that I use when I can figure out an API or how to test something (like testing controllers that use AuthLogic) is to look for the particular method––in this case activate_authlogic––on github and look at how other developers use it.

One of the problems with tutorials and documentation is that it never shows how to test code that uses the gem. This was the case for me today with AuthLogic. I was having a hard time figuring out where to put activate_authlogic and the code for logging in a user in order to test a controller. A quick search on github provided more than enough examples for both RSpec and Test::Unit.

Github trick – associate commits with your user account

May 9th, 2008 Comments off

On Github, in order to have your commits associated with your github user account, the email address you use when pushing code to the origin must match an email address associated with your github account. This is something I discovered after noticing that my commits were showing up as grey and not blue on the activity bar.

Setting your git email account is really easy. There are two different ways of doing it. First, you can directly edit your .git/config file and add a section like this:

[user]
	email = you@example.com
	name = Your Name

The second method is by using the following command from the root folder of your project:

git config user.name "Your Name"
git config user.email "you@example.com"
Categories: Git, Tips and Tricks Tags: