diff --git a/Gemfile b/Gemfile
index 99ca6608a6f28cea5aab16d63bcbd64649a1c80a..9eaffc4a94baad9761059fd408ef88ba3102f185 100644
--- a/Gemfile
+++ b/Gemfile
@@ -52,7 +52,7 @@ gem "browser", '~> 2.2'
 
 # Extracting information from a git repository
 # Provide access to Gitlab::Git library
-gem "gitlab_git", '~> 10.2'
+gem "gitlab_git", '~> 10.2', path: "~/src/Gitlab/gitlab_git"
 
 # LDAP Auth
 # GitLab fork with several improvements to original library. For full list of changes
diff --git a/Gemfile.lock b/Gemfile.lock
index af8fbedc127036087909f2e5f5c27e434e5fa076..96bb7b2e3d5322de7680d5cdbd81dae00f826e0f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,3 +1,12 @@
+PATH
+  remote: ~/src/Gitlab/gitlab_git
+  specs:
+    gitlab_git (10.3.0)
+      activesupport (~> 4.0)
+      charlock_holmes (~> 0.7.3)
+      github-linguist (~> 4.7.0)
+      rugged (~> 0.24.0)
+
 GEM
   remote: https://rubygems.org/
   specs:
@@ -274,11 +283,16 @@ GEM
       diff-lcs (~> 1.1)
       mime-types (>= 1.16, < 3)
       posix-spawn (~> 0.3)
+<<<<<<< 2da08236773692ac819a6acde0dfab8d26a26e30
     gitlab_git (10.2.3)
       activesupport (~> 4.0)
       charlock_holmes (~> 0.7.3)
       github-linguist (~> 4.7.0)
       rugged (~> 0.24.0)
+=======
+    gitlab_emoji (0.3.1)
+      gemojione (~> 2.2, >= 2.2.1)
+>>>>>>> refactors blob_controller
     gitlab_meta (7.0)
     gitlab_omniauth-ldap (1.2.1)
       net-ldap (~> 0.9)
@@ -389,6 +403,7 @@ GEM
     mail_room (0.8.0)
     method_source (0.8.2)
     mime-types (2.99.2)
+    mime-types-data (3.2016.0521)
     mimemagic (0.3.0)
     mini_portile2 (2.1.0)
     minitest (5.7.0)
@@ -861,7 +876,12 @@ DEPENDENCIES
   github-linguist (~> 4.7.0)
   github-markup (~> 1.3.1)
   gitlab-flowdock-git-hook (~> 1.0.1)
+<<<<<<< 2da08236773692ac819a6acde0dfab8d26a26e30
   gitlab_git (~> 10.2)
+=======
+  gitlab_emoji (~> 0.3.0)
+  gitlab_git (~> 10.2)!
+>>>>>>> refactors blob_controller
   gitlab_meta (= 7.0)
   gitlab_omniauth-ldap (~> 1.2.1)
   gollum-lib (~> 4.1.0)
diff --git a/app/controllers/concerns/creates_commit.rb b/app/controllers/concerns/creates_commit.rb
index 036805306f25b444e7db4ecf1daf67ad1e890fa6..a3731b45df0afaf06194239b05b5838e02c8c676 100644
--- a/app/controllers/concerns/creates_commit.rb
+++ b/app/controllers/concerns/creates_commit.rb
@@ -12,8 +12,16 @@ module CreatesCommit
       previous_path: @previous_path
     )
 
+    puts "#" * 10
+    puts @previous_path
+    puts "#" * 10
+
     result = service.new(@tree_edit_project, current_user, commit_params).execute
 
+    puts "#" * 30
+    puts result[:status]
+    puts "#" * 30
+
     if result[:status] == :success
       update_flash_notice(success_notice)
 
diff --git a/app/models/repository.rb b/app/models/repository.rb
index a5fb13eb662c6a8f46838d4bb8fcb1b2c039d011..bf45f48e61a07ebae17142cd5ec356628e354f87 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -749,25 +749,22 @@ class Repository
       options[:author] = committer
       options[:commit] = {
         message: message,
-        branch: ref,
+        branch: ref
       }
 
-      if previous_path
-        options[:file] = {
-          path: previous_path
-        }
-
-
-        Gitlab::Git::Blob.remove(raw_repository, options)
-      end
-
       options[:file] = {
         content: content,
         path: path,
         update: update
       }
 
-      Gitlab::Git::Blob.commit(raw_repository, options)
+      if previous_path
+        options[:file].merge!(previous_path: previous_path)
+
+        Gitlab::Git::Blob.rename(raw_repository, options)
+      else
+        Gitlab::Git::Blob.commit(raw_repository, options)
+      end
     end
   end