git_sha1_path = "#{RAILS_ROOT}/config/HEAD" GIT_SHA1 = if File.file?(git_sha1_path) File.open(git_sha1_path).readlines[0] end