diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index 1cfa3e5..6a7d183 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -48,6 +48,13 @@ class MyController < ApplicationController
     @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
   end
 
+  def remove_key
+    if params[:id]
+      AuthorizedKeysEntry.remove_entry_by_key(params[:id])
+      redirect_to :action => 'account'
+    end
+  end
+
   # Edit user's account
   def account
     @user = User.current
@@ -57,6 +64,14 @@ class MyController < ApplicationController
       @user.mail_notification = (params[:notification_option] == 'all')
       @user.pref.attributes = params[:pref]
       @user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
+      if params[:new_key]
+        begin
+          key = AuthorizedKeysEntry.new(params[:new_key],@user.login)
+          key.save
+        rescue ArgumentError => e
+          @user.errors.add('Key', e.message)
+        end
+      end
       if @user.save
         @user.pref.save
         @user.notified_project_ids = (params[:notification_option] == 'selected' ? params[:notified_project_ids] : [])
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index d41977d..14f1dc6 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -164,7 +164,11 @@ module RepositoriesHelper
   end
 
   def git_field_tags(form, repository)
-      content_tag('p', form.text_field(:url, :label => 'Path to .git directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
+      if Setting.serve_git_repositories? and (repository == nil or repository.url.blank?)
+          content_tag('p', form.text_field(:url, :value => GitManager.repositories_root + '/' + repository.project.identifier + '.git'), :label => 'Path to .git directory', :size => 60, :required => true)
+      else
+          content_tag('p', form.text_field(:url, :label => 'Path to .git directory', :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
+      end
   end
 
   def cvs_field_tags(form, repository)
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index 759d240..744fc2c 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -70,56 +70,74 @@ class Changeset < ActiveRecord::Base
     scan_comment_for_issue_ids
   end
   require 'pp'
-  
-  def scan_comment_for_issue_ids
-    return if comments.blank?
+
+  # returns issue ids found in message
+  # three arrays are returned, references issues, fixed ones and wrong numbers (not Issues)
+  def self.find_issue_ids(message, project)
+    return [[],[]] if message.blank?
     # keywords used to reference issues
     ref_keywords = Setting.commit_ref_keywords.downcase.split(",").collect(&:strip)
     # keywords used to fix issues
     fix_keywords = Setting.commit_fix_keywords.downcase.split(",").collect(&:strip)
-    # status and optional done ratio applied
-    fix_status = IssueStatus.find_by_id(Setting.commit_fix_status_id)
-    done_ratio = Setting.commit_fix_done_ratio.blank? ? nil : Setting.commit_fix_done_ratio.to_i
     
     kw_regexp = (ref_keywords + fix_keywords).collect{|kw| Regexp.escape(kw)}.join("|")
-    return if kw_regexp.blank?
+    return [[],[]] if kw_regexp.blank?
     
     referenced_issues = []
+    fixed_issues = []
+    wrong_issue_ids = []
     
     if ref_keywords.delete('*')
       # find any issue ID in the comments
       target_issue_ids = []
-      comments.scan(%r{([\s\(,-]|^)#(\d+)(?=[[:punct:]]|\s|<|$)}).each { |m| target_issue_ids << m[1] }
-      referenced_issues += repository.project.issues.find_all_by_id(target_issue_ids)
+      message.scan(%r{([\s\(,-]|^)#(\d+)(?=[[:punct:]]|\s|<|$)}).each { |m| target_issue_ids << m[1] }
+      found_issues = project.issues.find_all_by_id(target_issue_ids)
+      referenced_issues += found_issues
+      found_issues.each { |issue| target_issue_ids.delete(issue.id.to_s) }
+      wrong_issue_ids += target_issue_ids
     end
     
-    comments.scan(Regexp.new("(#{kw_regexp})[\s:]+(([\s,;&]*#?\\d+)+)", Regexp::IGNORECASE)).each do |match|
+    message.scan(Regexp.new("(#{kw_regexp})[\s:]+(([\s,;&]*#?\\d+)+)", Regexp::IGNORECASE)).each do |match|
       action = match[0]
       target_issue_ids = match[1].scan(/\d+/)
-      target_issues = repository.project.issues.find_all_by_id(target_issue_ids)
-      if fix_status && fix_keywords.include?(action.downcase)
-        # update status of issues
-        logger.debug "Issues fixed by changeset #{self.revision}: #{issue_ids.join(', ')}." if logger && logger.debug?
-        target_issues.each do |issue|
-          # the issue may have been updated by the closure of another one (eg. duplicate)
-          issue.reload
-          # don't change the status is the issue is closed
-          next if issue.status.is_closed?
-          csettext = "r#{self.revision}"
-          if self.scmid && (! (csettext =~ /^r[0-9]+$/))
-            csettext = "commit:\"#{self.scmid}\""
-          end
-          journal = issue.init_journal(user || User.anonymous, l(:text_status_changed_by_changeset, csettext))
-          issue.status = fix_status
-          issue.done_ratio = done_ratio if done_ratio
-          issue.save
-          Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
-        end
+      target_issues = project.issues.find_all_by_id(target_issue_ids)
+      target_issues.each { |issue| target_issue_ids.delete(issue.id.to_s) }
+      wrong_issue_ids += target_issue_ids
+      if fix_keywords.include?(action.downcase)
+        fixed_issues += target_issues
+      else
+        referenced_issues += target_issues
       end
-      referenced_issues += target_issues
     end
-    
-    self.issues = referenced_issues.uniq
+    return [referenced_issues.uniq, fixed_issues.uniq, wrong_issue_ids.uniq]
+  end
+  
+  def scan_comment_for_issue_ids
+    return if comments.blank?
+    # status and optional done ratio applied
+    fix_status = IssueStatus.find_by_id(Setting.commit_fix_status_id)
+    done_ratio = Setting.commit_fix_done_ratio.blank? ? nil : Setting.commit_fix_done_ratio.to_i
+
+    referenced_issues, fixed_issues, wrong_issues = Changeset.find_issue_ids(comments, repository.project)
+
+    # update status of issues
+    logger.debug "Issues fixed by changeset #{self.revision}: #{issue_ids.join(', ')}." if logger && logger.debug?
+    fixed_issues.each do |issue|
+      # the issue may have been updated by the closure of another one (eg. duplicate)
+      issue.reload
+      # don't change the status is the issue is closed
+      next if issue.status.is_closed?
+      csettext = "r#{self.revision}"
+      if self.scmid && (! (csettext =~ /^r[0-9]+$/))
+        csettext = "commit:\"#{self.scmid}\""
+      end
+      journal = issue.init_journal(user || User.anonymous, l(:text_status_changed_by_changeset, csettext))
+      issue.status = fix_status
+      issue.done_ratio = done_ratio if done_ratio
+      issue.save
+      Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
+    end
+    self.issues = (referenced_issues + fixed_issues).uniq
   end
   
   # Returns the previous changeset
diff --git a/app/models/user.rb b/app/models/user.rb
index 9692390..a384a85 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -65,6 +65,11 @@ class User < ActiveRecord::Base
   validates_length_of :password, :minimum => 4, :allow_nil => true
   validates_confirmation_of :password, :allow_nil => true
 
+
+  def ssh_key_entries
+    AuthorizedKeysEntry.find_by_identifier(login)
+  end
+
   def before_create
     self.mail_notification = false
     true
@@ -74,6 +79,7 @@ class User < ActiveRecord::Base
     # update hashed_password if password was set
     self.hashed_password = User.hash_password(self.password) if self.password
   end
+
   
   def reload(*args)
     @name = nil
@@ -271,6 +277,7 @@ private
   def self.hash_password(clear_password)
     Digest::SHA1.hexdigest(clear_password || "")
   end
+
 end
 
 class AnonymousUser < User
diff --git a/app/views/my/account.rhtml b/app/views/my/account.rhtml
index f4b726f..8ee1358 100644
--- a/app/views/my/account.rhtml
+++ b/app/views/my/account.rhtml
@@ -15,6 +15,15 @@
 <p><%= f.text_field :lastname, :required => true %></p>
 <p><%= f.text_field :mail, :required => true %></p>
 <p><%= f.select :language, lang_options_for_select %></p>
+<% if Setting.serve_git_repositories? %>
+  <table>
+  <% @user.ssh_key_entries.each do |e| %>
+    <tr><td><%= e.identifier + " " + e.key[0,30] %>... </td><td><%= link_to 'Remove', {:action => 'remove_key', :id =>  e.key[0,40]}, :confirm => "Are you sure?" %></td></tr>
+  <% end %>
+</table>
+  <p><%= text_area_tag :new_key, '' %></p>
+<% end %>
+
 </div>
 
 <%= submit_tag l(:button_save) %>
diff --git a/app/views/settings/_repositories.rhtml b/app/views/settings/_repositories.rhtml
index a8c9244..189648f 100644
--- a/app/views/settings/_repositories.rhtml
+++ b/app/views/settings/_repositories.rhtml
@@ -14,6 +14,14 @@
 <%= hidden_field_tag 'settings[enabled_scm][]', '' %>
 </p>
 
+<% # TODO: Should be disabled when Git SCM is not enabled 
+%>
+<p><label><%= l(:setting_serve_git_repositories) %></label>
+<%= check_box_tag 'settings[serve_git_repositories]', 1, Setting.serve_git_repositories? %>
+<%= hidden_field_tag 'settings[serve_git_repositories]', 0 %>
+</p>
+
+
 <p><label><%= l(:setting_repositories_encodings) %></label>
 <%= text_field_tag 'settings[repositories_encodings]', Setting.repositories_encodings, :size => 60 %><br /><em><%= l(:text_comma_separated) %></em></p>
 
diff --git a/config/settings.yml b/config/settings.yml
index 5006445..a3af36c 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -77,6 +77,8 @@ autofetch_changesets:
   default: 1
 sys_api_enabled:
   default: 0
+serve_git_repositories:
+  default: 0
 commit_ref_keywords:
   default: 'refs,references,IssueID'
 commit_fix_keywords:
diff --git a/lang/bg.yml b/lang/bg.yml
index 61f7520..b9acd01 100644
--- a/lang/bg.yml
+++ b/lang/bg.yml
@@ -92,6 +92,8 @@ field_is_required: Задължително
 field_firstname: Име
 field_lastname: Фамилия
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Файл
 field_filesize: Големина
 field_downloads: Downloads
@@ -181,6 +183,7 @@ setting_wiki_compression: Wiki компресиране на историята
 setting_feeds_limit: Лимит на Feeds
 setting_autofetch_changesets: Автоматично обработване на ревизиите
 setting_sys_api_enabled: Разрешаване на WS за управление
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Отбелязващи ключови думи
 setting_commit_fix_keywords: Приключващи ключови думи
 setting_autologin: Автоматичен вход
diff --git a/lang/ca.yml b/lang/ca.yml
index 0ce265f..b1bdcc7 100644
--- a/lang/ca.yml
+++ b/lang/ca.yml
@@ -106,6 +106,8 @@ field_is_required: Necessari
 field_firstname: Nom
 field_lastname: Cognom
 field_mail: Correu electrònic 
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Fitxer
 field_filesize: Mida
 field_downloads: Baixades
@@ -202,6 +204,7 @@ setting_feeds_limit: Límit de contingut del canal
 setting_default_projects_public: Els projectes nous són públics per defecte
 setting_autofetch_changesets: Omple automàticament les publicacions
 setting_sys_api_enabled: Habilita el WS per a la gestió del dipòsit
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Paraules claus per a la referència
 setting_commit_fix_keywords: Paraules claus per a la correcció
 setting_autologin: Entrada automàtica
diff --git a/lang/cs.yml b/lang/cs.yml
index 534da67..a50733b 100644
--- a/lang/cs.yml
+++ b/lang/cs.yml
@@ -106,6 +106,8 @@ field_is_required: Povinné pole
 field_firstname: Jméno
 field_lastname: Příjmení
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Soubor
 field_filesize: Velikost
 field_downloads: Staženo
@@ -201,6 +203,7 @@ setting_feeds_limit: Feed content limit
 setting_default_projects_public: Nové projekty nastavovat jako veřejné
 setting_autofetch_changesets: Autofetch commits
 setting_sys_api_enabled: Povolit WS pro správu repozitory
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Klíčová slova pro odkazy
 setting_commit_fix_keywords: Klíčová slova pro uzavření
 setting_autologin: Automatické přihlašování
diff --git a/lang/da.yml b/lang/da.yml
index 2edbc52..a1bf133 100644
--- a/lang/da.yml
+++ b/lang/da.yml
@@ -106,6 +106,8 @@ field_is_required: Skal udfyldes
 field_firstname: Fornavn
 field_lastname: Efternavn
 field_mail: E-mail
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Fil
 field_filesize: Størrelse
 field_downloads: Downloads
@@ -204,6 +206,7 @@ setting_autofetch_changesets: Hent automatisk commits
 setting_sys_api_enabled: Aktiver webservice til versionsstyring
 setting_commit_ref_keywords: Nøgleord for sagsreferencer
 setting_commit_fix_keywords: Nøgleord for lukning af sager
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_autologin: Autologin
 setting_date_format: Datoformat
 setting_time_format: Tidsformat
diff --git a/lang/de.yml b/lang/de.yml
index c403b48..2362c41 100644
--- a/lang/de.yml
+++ b/lang/de.yml
@@ -106,6 +106,8 @@ field_is_required: Erforderlich
 field_firstname: Vorname
 field_lastname: Nachname
 field_mail: E-Mail
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Datei
 field_filesize: Größe
 field_downloads: Downloads
@@ -203,6 +205,7 @@ setting_feeds_limit: Max. Anzahl Einträge pro Atom-Feed
 setting_default_projects_public: Neue Projekte sind standardmäßig öffentlich
 setting_autofetch_changesets: Changesets automatisch abrufen
 setting_sys_api_enabled: Webservice zur Verwaltung der Projektarchive benutzen
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Schlüsselwörter (Beziehungen)
 setting_commit_fix_keywords: Schlüsselwörter (Status)
 setting_autologin: Automatische Anmeldung
diff --git a/lang/en.yml b/lang/en.yml
index dad948e..57fac4c 100644
--- a/lang/en.yml
+++ b/lang/en.yml
@@ -108,6 +108,7 @@ field_is_required: Required
 field_firstname: Firstname
 field_lastname: Lastname
 field_mail: Email
+field_new_key: SSH Public Key
 field_filename: File
 field_filesize: Size
 field_downloads: Downloads
@@ -205,6 +206,7 @@ setting_feeds_limit: Feed content limit
 setting_default_projects_public: New projects are public by default
 setting_autofetch_changesets: Autofetch commits
 setting_sys_api_enabled: Enable WS for repository management
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Referencing keywords
 setting_commit_fix_keywords: Fixing keywords
 setting_autologin: Autologin
diff --git a/lang/es.yml b/lang/es.yml
index 1729292..b979921 100644
--- a/lang/es.yml
+++ b/lang/es.yml
@@ -150,6 +150,8 @@ field_last_login_on: Última conexión
 field_lastname: Apellido
 field_login: Identificador
 field_mail: Correo electrónico
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_mail_notification: Notificaciones por correo
 field_max_length: Longitud máxima
 field_min_length: Longitud mínima
@@ -627,6 +629,7 @@ setting_repositories_encodings: Codificaciones del repositorio
 setting_self_registration: Registro permitido
 setting_sequential_project_identifiers: Generar identificadores de proyecto
 setting_sys_api_enabled: Habilitar SW para la gestión del repositorio
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_text_formatting: Formato de texto
 setting_time_format: Formato de hora
 setting_user_format: Formato de nombre de usuario
diff --git a/lang/fi.yml b/lang/fi.yml
index 244f858..12b7db7 100644
--- a/lang/fi.yml
+++ b/lang/fi.yml
@@ -101,6 +101,8 @@ field_is_required: Vaaditaan
 field_firstname: Etunimi
 field_lastname: Sukunimi
 field_mail: Sähköposti
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Tiedosto
 field_filesize: Koko
 field_downloads: Latausta
@@ -194,6 +196,7 @@ setting_wiki_compression: Wiki historian pakkaus
 setting_feeds_limit: Syötteen sisällön raja
 setting_autofetch_changesets: Automaattisten muutosjoukkojen haku
 setting_sys_api_enabled: Salli WS tietovaraston hallintaan
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Viittaavat hakusanat
 setting_commit_fix_keywords: Korjaavat hakusanat
 setting_autologin: Automaatinen kirjautuminen
diff --git a/lang/fr.yml b/lang/fr.yml
index 374a0d8..dc6b772 100644
--- a/lang/fr.yml
+++ b/lang/fr.yml
@@ -108,6 +108,8 @@ field_is_required: Obligatoire
 field_firstname: Prénom
 field_lastname: Nom
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Fichier
 field_filesize: Taille
 field_downloads: Téléchargements
@@ -205,6 +207,7 @@ setting_feeds_limit: Limite du contenu des flux RSS
 setting_default_projects_public: Définir les nouveaux projects comme publics par défaut
 setting_autofetch_changesets: Récupération auto. des commits
 setting_sys_api_enabled: Activer les WS pour la gestion des dépôts
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Mot-clés de référencement
 setting_commit_fix_keywords: Mot-clés de résolution
 setting_autologin: Autologin
diff --git a/lang/he.yml b/lang/he.yml
index b10b732..8abfb0e 100644
--- a/lang/he.yml
+++ b/lang/he.yml
@@ -94,6 +94,8 @@ field_is_required: נדרש
 field_firstname: שם פרטי
 field_lastname: שם משפחה
 field_mail: דוא"ל
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: קובץ
 field_filesize: גודל
 field_downloads: הורדות
@@ -184,6 +186,7 @@ setting_wiki_compression: כיווץ היסטורית WIKI
 setting_feeds_limit: גבול תוכן הזנות
 setting_autofetch_changesets: משיכה אוטומתי של עידכונים
 setting_sys_api_enabled: אפשר WS לניהול המאגר
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: מילות מפתח מקשרות
 setting_commit_fix_keywords: מילות מפתח מתקנות
 setting_autologin: חיבור אוטומטי
diff --git a/lang/hu.yml b/lang/hu.yml
index 059b3ee..1c95590 100644
--- a/lang/hu.yml
+++ b/lang/hu.yml
@@ -103,6 +103,8 @@ field_is_required: Kötelező
 field_firstname: Keresztnév
 field_lastname: Vezetéknév
 field_mail: E-mail
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Fájl
 field_filesize: Méret
 field_downloads: Letöltések
@@ -198,6 +200,7 @@ setting_feeds_limit: RSS tartalom korlát
 setting_default_projects_public: Az új projektek alapértelmezés szerint nyilvánosak
 setting_autofetch_changesets: Commitok automatikus lehúzása
 setting_sys_api_enabled: WS engedélyezése a tárolók kezeléséhez
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Hivatkozó kulcsszavak
 setting_commit_fix_keywords: Javítások kulcsszavai
 setting_autologin: Automatikus bejelentkezés
diff --git a/lang/it.yml b/lang/it.yml
index f3798b4..db35a4a 100644
--- a/lang/it.yml
+++ b/lang/it.yml
@@ -92,6 +92,8 @@ field_is_required: Richiesto
 field_firstname: Nome
 field_lastname: Cognome
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: File
 field_filesize: Dimensione
 field_downloads: Download
@@ -181,6 +183,7 @@ setting_wiki_compression: Comprimi cronologia wiki
 setting_feeds_limit: Limite contenuti del feed
 setting_autofetch_changesets: Acquisisci automaticamente le commit
 setting_sys_api_enabled: Abilita WS per la gestione del repository
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Referencing keywords
 setting_commit_fix_keywords: Fixing keywords
 setting_autologin: Login automatico
diff --git a/lang/ja.yml b/lang/ja.yml
index c1279b3..0875e66 100644
--- a/lang/ja.yml
+++ b/lang/ja.yml
@@ -93,6 +93,8 @@ field_is_required: 必須
 field_firstname: 名前
 field_lastname: 苗字
 field_mail: メールアドレス
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: ファイル
 field_filesize: サイズ
 field_downloads: ダウンロード
@@ -182,6 +184,7 @@ setting_wiki_compression: Wiki履歴を圧縮する
 setting_feeds_limit: フィード内容の上限
 setting_autofetch_changesets: コミットを自動取得する
 setting_sys_api_enabled: リポジトリ管理用のWeb Serviceを有効にする
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: 参照用キーワード
 setting_commit_fix_keywords: 修正用キーワード
 setting_autologin: 自動ログイン
diff --git a/lang/ko.yml b/lang/ko.yml
index f7958f9..3818080 100644
--- a/lang/ko.yml
+++ b/lang/ko.yml
@@ -94,6 +94,8 @@ field_is_required: 필수
 field_firstname: 이름
 field_lastname: 성
 field_mail: 메일
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: 파일
 field_filesize: 크기
 field_downloads: 다운로드
@@ -184,6 +186,7 @@ setting_wiki_compression: 위키 이력 압축
 setting_feeds_limit: 내용 피드(RSS Feed) 제한 개수
 setting_autofetch_changesets: 커밋된 변경묶음을 자동으로 가져오기
 setting_sys_api_enabled: 저장소 관리자에 WS 를 허용
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: 일감 참조에 사용할 키워드들
 setting_commit_fix_keywords: 일감 해결에 사용할 키워드들 
 setting_autologin: 자동 로그인
diff --git a/lang/lt.yml b/lang/lt.yml
index 3cdbcf0..ca56fb8 100644
--- a/lang/lt.yml
+++ b/lang/lt.yml
@@ -106,6 +106,8 @@ field_is_required: Reikalaujama
 field_firstname: Vardas
 field_lastname: Pavardė
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Byla
 field_filesize: Dydis
 field_downloads: Atsiuntimai
@@ -203,6 +205,7 @@ setting_feeds_limit: Perdavimo turinio riba
 setting_default_projects_public: Naujas projektas viešas pagal nutylėjimą
 setting_autofetch_changesets: Automatinis pakeitimų siuntimas
 setting_sys_api_enabled: Įgalinkite WS sandėlio vadybai
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Nurodymo reikšminiai žodžiai
 setting_commit_fix_keywords: Fiksavimo reikšminiai žodžiai
 setting_autologin: Autoregistracija
diff --git a/lang/nl.yml b/lang/nl.yml
index ed10b4d..1d2bcbc 100644
--- a/lang/nl.yml
+++ b/lang/nl.yml
@@ -148,6 +148,8 @@ field_attr_mail: E-mail attribuut
 field_onthefly: On-the-fly aanmaken van een gebruiker
 field_start_date: Start
 field_done_ratio: %% Gereed
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_auth_source: Authenticatiemethode
 field_hide_mail: Verberg mijn e-mailadres
 field_comments: Commentaar
@@ -638,6 +640,7 @@ field_parent_title: Bovenliggende pagina
 label_issue_watchers: Monitoren
 setting_commit_logs_encoding: Encodering van commit berichten
 button_quote: Citaat
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_sequential_project_identifiers: Genereer sequentiële projectidentiteiten
 notice_unable_delete_version: Niet mogelijk om deze versie te verwijderen.
 label_renamed: hernoemd
diff --git a/lang/no.yml b/lang/no.yml
index c8f131f..aa9c843 100644
--- a/lang/no.yml
+++ b/lang/no.yml
@@ -105,6 +105,8 @@ field_is_required: Kreves
 field_firstname: Fornavn
 field_lastname: Etternavn
 field_mail: E-post
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Fil
 field_filesize: Størrelse
 field_downloads: Nedlastinger
@@ -200,6 +202,7 @@ setting_feeds_limit: Innholdsgrense for Feed
 setting_default_projects_public: Nye prosjekter er offentlige som standard
 setting_autofetch_changesets: Autohenting av innsendinger
 setting_sys_api_enabled: Aktiver webservice for depot-administrasjon
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Nøkkelord for referanse
 setting_commit_fix_keywords: Nøkkelord for retting
 setting_autologin: Autoinnlogging
diff --git a/lang/pl.yml b/lang/pl.yml
index 6b28f0e..31c2dae 100644
--- a/lang/pl.yml
+++ b/lang/pl.yml
@@ -161,6 +161,8 @@ field_last_login_on: Ostatnie połączenie
 field_lastname: Nazwisko
 field_login: Login
 field_mail: Email
+field_ssh_key: Klucz publiczny SSH
+field_ssh_key_type: Typ klucza SSH
 field_mail_notification: Powiadomienia Email
 field_max_length: Maksymalna długość
 field_min_length: Minimalna długość
@@ -657,6 +659,7 @@ setting_repositories_encodings: Kodowanie repozytoriów
 setting_self_registration: Własna rejestracja umożliwiona
 setting_sequential_project_identifiers: Generuj sekwencyjne identyfikatory projektów
 setting_sys_api_enabled: Włączenie WS do zarządzania repozytorium
+setting_serve_git_repositories: Udostępnij repozytoria GIT poprzez konto SSH Redmine
 setting_text_formatting: Formatowanie tekstu
 setting_time_format: Format czasu
 setting_user_format: Personalny format wyświetlania
diff --git a/lang/pt-br.yml b/lang/pt-br.yml
index ecbbc0c..716a1d7 100644
--- a/lang/pt-br.yml
+++ b/lang/pt-br.yml
@@ -105,6 +105,8 @@ field_is_required: Obrigatório
 field_firstname: Nome
 field_lastname: Sobrenome
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Arquivo
 field_filesize: Tamanho
 field_downloads: Downloads
@@ -201,6 +203,7 @@ setting_feeds_limit: Limite do Feed
 setting_default_projects_public: Novos projetos são públicos por padrão
 setting_autofetch_changesets: Auto-obter commits
 setting_sys_api_enabled: Ativa WS para gerenciamento do repositório
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Palavras de referência
 setting_commit_fix_keywords: Palavras de fechamento
 setting_autologin: Auto-login
diff --git a/lang/pt.yml b/lang/pt.yml
index ec42386..6149d34 100644
--- a/lang/pt.yml
+++ b/lang/pt.yml
@@ -107,6 +107,8 @@ field_is_required: Obrigatório
 field_firstname: Nome
 field_lastname: Apelido
 field_mail: E-mail
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Ficheiro
 field_filesize: Tamanho
 field_downloads: Downloads
@@ -203,6 +205,7 @@ setting_feeds_limit: Limite de conteúdo do feed
 setting_default_projects_public: Projectos novos são públicos por omissão
 setting_autofetch_changesets: Buscar automaticamente commits
 setting_sys_api_enabled: Activar Web Service para gestão do repositório
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Palavras-chave de referência
 setting_commit_fix_keywords: Palavras-chave de fecho
 setting_autologin: Login automático
diff --git a/lang/ro.yml b/lang/ro.yml
index b0df48d..25be71e 100644
--- a/lang/ro.yml
+++ b/lang/ro.yml
@@ -92,6 +92,8 @@ field_is_required: Obligatoriu
 field_firstname: Nume
 field_lastname: Prenume
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Fisier
 field_filesize: Marimea fisierului
 field_downloads: Download
@@ -181,6 +183,7 @@ setting_wiki_compression: Compresie istoric wiki
 setting_feeds_limit: Limita continut feed
 setting_autofetch_changesets: Autofetch commits
 setting_sys_api_enabled: Setare WS pentru managementul stocului (repository)
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Cuvinte cheie de referinta
 setting_commit_fix_keywords: Cuvinte cheie de rezolvare
 setting_autologin: Autentificare automata
diff --git a/lang/ru.yml b/lang/ru.yml
index 4943eea..91db5b1 100644
--- a/lang/ru.yml
+++ b/lang/ru.yml
@@ -165,6 +165,8 @@ field_last_login_on: Последнее подключение
 field_lastname: Фамилия
 field_login: Пользователь
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_mail_notification: Уведомления по email
 field_max_length: Максимальная длина
 field_min_length: Минимальная длина
@@ -673,6 +675,7 @@ setting_repositories_encodings: Кодировки хранилища
 setting_self_registration: Возможна саморегистрация
 setting_sequential_project_identifiers: Генерировать последовательные идентификаторы проектов
 setting_sys_api_enabled: Разрешить WS для управления хранилищем
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_text_formatting: Форматирование текста
 setting_time_format: Формат времени
 setting_user_format: Формат отображения имени
diff --git a/lang/sk.yml b/lang/sk.yml
index ffae2d6..5297432 100644
--- a/lang/sk.yml
+++ b/lang/sk.yml
@@ -106,6 +106,8 @@ field_is_required: Povinné pole
 field_firstname: Meno
 field_lastname: Priezvisko
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Súbor
 field_filesize: Veľkosť
 field_downloads: Stiahnuté
@@ -201,6 +203,7 @@ setting_feeds_limit: Limit zobrazených položiek (Atom feed)
 setting_default_projects_public: Nové projekty nastavovať ako verejné
 setting_autofetch_changesets: Automatický prenos zmien
 setting_sys_api_enabled: Povolit WS pre správu repozitory
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Klúčové slová pre odkazy
 setting_commit_fix_keywords: Klúčové slová pre uzavretie
 setting_autologin: Automatické prihlasovanie
@@ -698,10 +701,10 @@ label_example: Príklad
 permission_edit_own_messages: Edit own messages
 permission_delete_own_messages: Delete own messages
 text_repository_usernames_mapping: "Select or update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
-label_user_activity: "%s's activity"
-label_updated_time_by: Updated by %s %s ago
-text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
-setting_diff_max_lines_displayed: Max number of diff lines displayed
-text_plugin_assets_writable: Plugin assets directory writable
-warning_attachments_not_saved: "%d file(s) could not be saved."
-button_create_and_continue: Create and continue
+label_user_activity: "%s's activity"
+label_updated_time_by: Updated by %s %s ago
+text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
+setting_diff_max_lines_displayed: Max number of diff lines displayed
+text_plugin_assets_writable: Plugin assets directory writable
+warning_attachments_not_saved: "%d file(s) could not be saved."
+button_create_and_continue: Create and continue
diff --git a/lang/sr.yml b/lang/sr.yml
index 7070c4a..39031e6 100644
--- a/lang/sr.yml
+++ b/lang/sr.yml
@@ -96,6 +96,8 @@ field_is_required: Zahtevano
 field_firstname: Ime
 field_lastname: Prezime
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Fajl
 field_filesize: Veličina
 field_downloads: Preuzimanja
@@ -186,6 +188,7 @@ setting_wiki_compression: Kompresija wiki history-a
 setting_feeds_limit: Feed content limit
 setting_autofetch_changesets: Autofetch commits
 setting_sys_api_enabled: Ukljuci WS za menadžment spremišta
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Referentne ključne reči
 setting_commit_fix_keywords: Fiksne ključne reči
 setting_autologin: Automatsko prijavljivanje
diff --git a/lang/sv.yml b/lang/sv.yml
index 852c7fe..29a80e4 100644
--- a/lang/sv.yml
+++ b/lang/sv.yml
@@ -106,6 +106,8 @@ field_is_required: Obligatorisk
 field_firstname: Förnamn
 field_lastname: Efternamn
 field_mail: Mail
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Fil
 field_filesize: Storlek
 field_downloads: Nerladdningar
@@ -203,6 +205,7 @@ setting_feeds_limit: Innehållsgräns för Feed
 setting_default_projects_public: Nya projekt är publika som standard
 setting_autofetch_changesets: Automatisk hämtning av commits
 setting_sys_api_enabled: Aktivera WS för repository-hantering
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Referens-nyckelord
 setting_commit_fix_keywords: Fix-nyckelord
 setting_autologin: Automatisk inloggning
diff --git a/lang/th.yml b/lang/th.yml
index c0a3859..e8d93f1 100644
--- a/lang/th.yml
+++ b/lang/th.yml
@@ -103,6 +103,8 @@ field_is_required: ต้องใส่
 field_firstname: ชื่อ
 field_lastname: นามสกุล
 field_mail: อีเมล์
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: แฟ้ม
 field_filesize: ขนาด
 field_downloads: ดาวน์โหลด
@@ -198,6 +200,7 @@ setting_feeds_limit: จำนวน Feed
 setting_default_projects_public: โครงการใหม่มีค่าเริ่มต้นเป็น สาธารณะ
 setting_autofetch_changesets: ดึง commits อัตโนมัติ
 setting_sys_api_enabled: เปิดใช้ WS สำหรับการจัดการที่เก็บต้นฉบับ
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: คำสำคัญ Referencing
 setting_commit_fix_keywords: คำสำคัญ Fixing
 setting_autologin: เข้าระบบอัตโนมัติ
diff --git a/lang/tr.yml b/lang/tr.yml
index 8136367..1bb9eb3 100644
--- a/lang/tr.yml
+++ b/lang/tr.yml
@@ -102,6 +102,8 @@ field_is_required: Gerekli
 field_firstname: Ad
 field_lastname: Soyad
 field_mail: E-Posta
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Dosya
 field_filesize: Boyut
 field_downloads: İndirilenler
@@ -197,6 +199,7 @@ setting_feeds_limit: Haber yayını içerik limiti
 setting_default_projects_public: Yeni projeler varsayılan olarak herkese açık
 setting_autofetch_changesets: Otomatik gönderi al
 setting_sys_api_enabled: Depo yönetimi için WS'yi etkinleştir
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Başvuru Kelimeleri
 setting_commit_fix_keywords: Sabitleme kelimeleri
 setting_autologin: Otomatik Giriş
diff --git a/lang/uk.yml b/lang/uk.yml
index be121cb..3a5840e 100644
--- a/lang/uk.yml
+++ b/lang/uk.yml
@@ -97,6 +97,8 @@ field_is_required: Необхідно
 field_firstname: Ім'я
 field_lastname: Прізвище
 field_mail: Ел. пошта
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Файл
 field_filesize: Розмір
 field_downloads: Завантаження
@@ -189,6 +191,7 @@ setting_wiki_compression: Стиснення історії Wiki
 setting_feeds_limit: Обмеження змісту подачі
 setting_autofetch_changesets: Автоматично доставати доповнення
 setting_sys_api_enabled: Дозволити WS для управління репозиторієм
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Ключові слова для посилання
 setting_commit_fix_keywords: Призначення ключових слів
 setting_autologin: Автоматичний вхід
diff --git a/lang/vn.yml b/lang/vn.yml
index 908e232..24b800f 100644
--- a/lang/vn.yml
+++ b/lang/vn.yml
@@ -106,6 +106,8 @@ field_is_required: Bắt buộc
 field_firstname: Tên lót + Tên
 field_lastname: Họ
 field_mail: Email
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: Tập tin
 field_filesize: Cỡ
 field_downloads: Tải về
@@ -202,6 +204,7 @@ setting_feeds_limit: Giới hạn nội dung của feed
 setting_default_projects_public: Dự án mặc định là công cộng
 setting_autofetch_changesets: Autofetch commits
 setting_sys_api_enabled: Enable WS for repository management
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: Từ khóa tham khảo
 setting_commit_fix_keywords: Từ khóa chỉ vấn đề đã giải quyết
 setting_autologin: Tự động đăng nhập
diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml
index 50eccf4..5ccd4a0 100644
--- a/lang/zh-tw.yml
+++ b/lang/zh-tw.yml
@@ -106,6 +106,8 @@ field_is_required: 必填
 field_firstname: 名字
 field_lastname: 姓氏
 field_mail: 電子郵件
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: 檔案名稱
 field_filesize: 大小
 field_downloads: 下載次數
@@ -203,6 +205,7 @@ setting_feeds_limit: RSS 新聞限制
 setting_autofetch_changesets: 自動取得送交版次
 setting_default_projects_public: 新建立之專案預設為「公開」
 setting_sys_api_enabled: 啟用管理版本庫之網頁服務 (Web Service)
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: 送交用於參照項目之關鍵字
 setting_commit_fix_keywords: 送交用於修正項目之關鍵字
 setting_autologin: 自動登入
diff --git a/lang/zh.yml b/lang/zh.yml
index 989f329..32f889b 100644
--- a/lang/zh.yml
+++ b/lang/zh.yml
@@ -106,6 +106,8 @@ field_is_required: 必填
 field_firstname: 名字
 field_lastname: 姓氏
 field_mail: 邮件地址
+field_ssh_key: SSH Public Key
+field_ssh_key_type: SSH Public Key Type
 field_filename: 文件
 field_filesize: 大小
 field_downloads: 下载次数
@@ -203,6 +205,7 @@ setting_feeds_limit: RSS Feed内容条数限制
 setting_default_projects_public: 新建项目默认为公开项目
 setting_autofetch_changesets: 自动获取程序变更
 setting_sys_api_enabled: 启用用于版本库管理的Web Service
+setting_serve_git_repositories: Serve GIT repositories using Redmine's SSH account
 setting_commit_ref_keywords: 用于引用问题的关键字
 setting_commit_fix_keywords: 用于解决问题的关键字
 setting_autologin: 自动登录
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index a9e1dda..77dd6ca 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -24,6 +24,25 @@ module Redmine
         
         # Git executable name
         GIT_BIN = "git"
+	EMPTY_COMMIT = "0000000000000000000000000000000000000000"
+
+        def init(description)
+          FileUtils.mkdir_p "#{url}"
+          cmd = "#{GIT_BIN} --git-dir #{target('')} init --template=#{RAILS_ROOT}/lib/redmine/scm/adapters/git_templates --bare"
+          shellout(cmd)
+          Dir["#{url}/**/*"].each do |file|
+            if File.file?(file)
+              File.open(file, "r") do |source|
+                File.open(file + ".new", "w", File.stat(file).mode) do |dest|
+                  source.each_line do |line|
+                    dest << line.gsub('#{description}', description).gsub('#{RAILS_ROOT}', RAILS_ROOT).gsub('#{RAILS_ENV}', ENV["RAILS_ENV"])
+                  end
+                end
+              end
+              FileUtils.mv file + ".new", file
+            end
+          end
+        end
 
         # Get the revision of a particuliar file
         def get_rev (rev,path)
@@ -61,7 +80,7 @@ module Redmine
               elsif (parsing_descr == 0) && line =~ /^(\w+):\s*(.*)$/
                 key = $1
                 value = $2
-                if key == "Author"
+                if key == "Commit"
                   changeset[:author] = value
                 elsif key == "CommitDate"
                   changeset[:date] = value
@@ -140,7 +159,7 @@ module Redmine
           cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw --date=iso --pretty=fuller"
           cmd << " --reverse" if options[:reverse]
           cmd << " -n #{options[:limit].to_i} " if (!options.nil?) && options[:limit]
-          cmd << " #{shell_quote(identifier_from + '..')} " if identifier_from
+          cmd << " #{shell_quote(identifier_from + '..')} " if identifier_from and identifier_from != EMPTY_COMMIT
           cmd << " #{shell_quote identifier_to} " if identifier_to
           shellout(cmd) do |io|
             files=[]
@@ -262,6 +281,21 @@ module Redmine
           return nil if $? && $?.exitstatus != 0
           cat
         end
+
+        def get_object_type(object)
+          cmd = "#{GIT_BIN} --git-dir #{target('')} cat-file -t #{object}"
+          type = ""
+          GitAdapter.shellout(cmd) do |io|
+            return io.read.strip
+          end
+        end
+
+        def merge_base(old_rev, new_rev)
+          cmd = "#{GIT_BIN} --git-dir #{target('')} merge-base #{old_rev} #{new_rev}"
+          GitAdapter.shellout(cmd) do |io|
+            return io.read.strip
+          end
+        end
       end
     end
   end
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 2e60ee4..70735de 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -240,7 +240,7 @@ ul.properties li span {font-style:italic;}
 .total-hours span.hours-int { font-size: 120%; }
 
 .autoscroll {overflow-x: auto; padding:1px; margin-bottom: 1.2em;}
-#user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; }
+#user_firstname, #user_lastname, #user_mail, #new_key, #my_account_form select { width: 90%; }
 
 .pagination {font-size: 90%}
 p.pagination {margin-top:8px;}
