On Thu, 6 Mar 2014 14:32:05 -0800 (PST)
John Schmidt <john.schmidt4...@gmail.com> wrote:

> i created a bare rep on my remote server and i would like to push
> data to it via Sourcetree.
> 
> I connect via SSH with private key.
> 
> I get the following error-message: '... *does not appear to be a git 
> repository*'
> 
> I googled a lot finding basically always the same hint: The path to
> your repository must be wrong...
> 
> 
> My SSH connection-strings looks like this:
> 
> *ssh -i /path/to/key/key.pem user@<IP>/var/www/myRep.git*
> 
> My Repository on my remote server is in the following folder:
> 
> */var/www/myRep.git*
> 
> The path is right.
[...]

Unfortunately, the error you're observing might be cause by a whole
number of different reasons so you'll have to debug.

The first thing to check is to verify you're really able to
successfully connect and authenticate using the user+IP+key triplet.
To check this do

  $ ssh -i /path/to/key/key.pem user@<IP> git --version

If everything went OK and you've received back something like
"git version 1.X.Y.Z", skip to the next step.
If it failed, try to make out from the output generated what *exactly*
failed.  A couple of things to look for:

* Your SSH key is encrypted with a passphrase, and the SSH client asks
  you to enter a passphrase to unlock the key.  Since this program is
  being run unattended (by another program) it has no way to display
  its prompt, so it dies and Git reports the failure.

  Hence if that "ssh -i ..." command asks your for the passphrase, this
  *is* the problem.

* Alternatively, the SSH client might be trying to ask you whether you
  trust the key the SSH server is presenting.

  If this is the case, then just answer yes, and this choice will be
  memorized and not asked again.  The next call to "ssh -i ..." won't
  ask it again.

* Your user "user" has no write access to the indicated directory.
  I'm not sure whether the serving process changes directory to the
  location of the repository it serves but if it does, you'll also
  make sure it has execute permission on that directory.

  To verify this, when SSH is known to work OK, modify your command
  slightly and do

  $ ssh -i /path/to/key/key.pem user@<IP> \
    cd /var/www/myRep.git && touch foo

  (The "\" is not part of the command, it's just to wrap the long line.)

  Only if that works, you're sort-of guaranteed Git operations should
  work.

* If all else fails, try using plain Git for Windows client from the
  command line and trace its execution, like this:

  - For the Windows console window (cmd.exe):

    set GIT_TRACE=1
    git push origin

  - For Git bash:

    export GIT_TRACE=1
    git push origin

And try to make out what exactly command fails from those called by Git.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to