diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index 48bd57f4c104c753ce3c7131c770b524d54ee1e5..3ddef99c64598e5282084bbf3b788e5e6b2f4b50 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -399,6 +399,10 @@ class Installer {
 			$apps = $this->appFetcher->get();
 		}
 
+		if ($this->isInstalledFromGit($appId) === true) {
+			return false;
+		}
+
 		foreach($apps as $app) {
 			if($app['id'] === $appId) {
 				$currentVersion = OC_App::getAppVersion($appId);
@@ -414,6 +418,22 @@ class Installer {
 		return false;
 	}
 
+	/**
+	 * Check if app has been installed from git
+	 * @param string $name name of the application to remove
+	 * @return boolean
+	 *
+	 * The function will check if the path contains a .git folder
+	 */
+	private function isInstalledFromGit($appId) {
+		$app = \OC_App::findAppInDirectories($appId);
+		if($app === false) {
+			return false;
+		}
+		$basedir = $app['path'].'/'.$appId;
+		return file_exists($basedir.'/.git/');
+	}
+
 	/**
 	 * Check if app is already downloaded
 	 * @param string $name name of the application to remove