     for {pack, latestVersion} in updates
       do (pack, latestVersion) ->
         installCommands.push (callback) ->
-          commandArgs = ["#{pack.name}@#{latestVersion}"]
+          if pack.apmInstallSource?.type is 'git'
+            commandArgs = [pack.apmInstallSource.source]
+          else
+            commandArgs = ["#{pack.name}@#{latestVersion}"]
           commandArgs.unshift('--verbose') if verbose
           new Install().run({callback, commandArgs})
 

      return callback(error) if error?

      if options.argv.json
        packagesWithLatestVersion = updates.map ({pack, latestVersion}) ->
          pack.latestVersion = latestVersion
          pack
        console.log JSON.stringify(packagesWithLatestVersion)
      else
        console.log "Package Updates Available".cyan + " (#{updates.length})"
        tree updates, ({pack, latestVersion}) ->
          "#{pack.name.yellow} #{pack.version.red} -> #{latestVersion.green}"

      return callback() if options.command is 'outdated'
      return callback() if options.argv.list

          latestVersion = version if semver.gt(version, latestVersion)

        if latestVersion isnt pack.version and @hasRepo(pack)
          callback(null, latestVersion)
        else
          callback()

  getLatestSha: (pack, callback) ->
    repoPath = path.join(@atomPackagesDirectory, pack.name)
    @spawn 'git', ['fetch', 'origin', 'master'], {cwd: repoPath}, (code, stderr='', stdout='') =>
      return callback(code) unless code is 0
      repo = Git.open(repoPath)
      sha = repo.getReferenceTarget(repo.getUpstreamBranch('refs/heads/master'))
      if sha isnt pack.apmInstallSource.sha
        callback(null, sha)
      else
        callback()

  hasRepo: (pack) ->
    Packages.getRepository(pack)?

  getAvailableUpdates: (packages, callback) ->
    getLatestVersionOrSha = (pack, done) =>
      if pack.apmInstallSource?.type is 'git'
        @getLatestSha pack, (err, sha) =>
          done(err, {pack, sha})
      else
        @getLatestVersion pack, (err, latestVersion) =>
          done(err, {pack, latestVersion})

    async.map packages, getLatestVersionOrSha, (error, updates) ->
      return callback(error) if error?

      updates = _.filter updates, (update) -> update.latestVersion? or update.sha?
      updates.sort (updateA, updateB) ->
        updateA.pack.name.localeCompare(updateB.pack.name)

