diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb
index 79703cf104a6bdf2bd0ef92248964273609f241a..1afe25a745c46d7426b411e4037b50615cdd2282 100644
--- a/app/controllers/commits_controller.rb
+++ b/app/controllers/commits_controller.rb
@@ -13,7 +13,7 @@ def index
     load_refs # load @branch, @tag & @ref
 
     @repo = project.repo
-    limit, offset = (params[:limit] || 20), (params[:offset] || 0) 
+    limit, offset = (params[:limit] || 20), (params[:offset] || 0)
 
     if params[:path]
       @commits = @repo.log(@ref, params[:path], :max_count => limit, :skip => offset)
@@ -24,6 +24,7 @@ def index
     respond_to do |format|
       format.html # index.html.erb
       format.js
+      format.atom { render :layout => false }
     end
   end
 
@@ -32,7 +33,7 @@ def show
     @notes = project.notes.where(:noteable_id => @commit.id, :noteable_type => "Commit").order("created_at DESC").limit(20)
     @note = @project.notes.new(:noteable_id => @commit.id, :noteable_type => "Commit")
 
-    respond_to do |format| 
+    respond_to do |format|
       format.html
       format.js { respond_with_notes }
     end
diff --git a/app/views/commits/index.atom.builder b/app/views/commits/index.atom.builder
new file mode 100644
index 0000000000000000000000000000000000000000..2a352dac1b79927448582fe8eea35cf0490f56b2
--- /dev/null
+++ b/app/views/commits/index.atom.builder
@@ -0,0 +1,23 @@
+xml.instruct!
+xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
+  xml.title   "Recent commits to #{@project.name}:#{@ref}"
+  xml.link    :href => project_commits_url(@project, :atom, :ref => @ref), :rel => "self", :type => "application/atom+xml"
+  xml.link    :href => project_commits_url(@project), :rel => "alternate", :type => "text/html"
+  xml.id      project_commits_url(@project)
+  xml.updated @commits.first.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ") if @commits.any?
+
+  @commits.each do |commit|
+    xml.entry do
+      xml.id      project_commit_url(@project, :id => commit.id)
+      xml.link    :href => project_commit_url(@project, :id => commit.id)
+      xml.title   truncate(commit.safe_message, :length => 80)
+      xml.updated commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")
+      xml.media   :thumbnail, :width => "40", :height => "40", :url => gravatar_icon(commit.author_email)
+      xml.author do |author|
+        xml.name commit.author_name
+        xml.email commit.author_email
+      end
+      xml.summary commit.safe_message
+    end
+  end
+end
diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml
index 0550d89e207944973fe9df307d1a2a9726807e58..927d62db2958422999b9f5dd8baf107d3b2c0738 100644
--- a/app/views/layouts/project.html.haml
+++ b/app/views/layouts/project.html.haml
@@ -5,6 +5,8 @@
       GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
     = stylesheet_link_tag    "application"
     = javascript_include_tag "application"
+    - if current_page?(tree_project_path(@project)) || current_page?(project_commits_path(@project))
+      = auto_discovery_link_tag(:atom, project_commits_url(@project, :atom, :ref => @ref), :title => "Recent commits to #{@project.name}:#{@ref}")
     = csrf_meta_tags
     = javascript_tag do
       REQ_URI = "#{request.env["REQUEST_URI"]}";
diff --git a/spec/requests/commits_spec.rb b/spec/requests/commits_spec.rb
index 79bb03f53b6ceeb44ca2f40b7263e057c6c3e292..2bbd6b9f10447e200c656965625c2b938612517d 100644
--- a/spec/requests/commits_spec.rb
+++ b/spec/requests/commits_spec.rb
@@ -25,6 +25,15 @@
       page.should have_content(commit.author)
       page.should have_content(commit.message)
     end
+
+    it "should render atom feed" do
+      visit project_commits_path(project, :atom)
+
+      page.response_headers['Content-Type'].should have_content("application/atom+xml")
+      page.body.should have_selector("title", :text => "Recent commits to #{project.name}")
+      page.body.should have_selector("author email", :text => commit.author_email)
+      page.body.should have_selector("entry summary", :text => commit.message)
+    end
   end
 
   describe "GET /commits/:id" do