Search code examples
gitsmartgit

GIT - '~/repo.git/' is not a git command


I have a problem with with remote git repo and local repo (using SmartGit).

I'm creating remote repo on my server via ssh:

> cd ~
> git init repo.git
> cd repo.git
> touch readme
> git add .
> git commit -m "Initial commit"

From here everything seems perfect. Now I'm trying to clone repo using Smartgit with command

ssh://user@server:22/~/repo.git

Everything is cloning well. I make changes in readme file, saving it and trying to commit and push and getting error:

The remote end hang up unexpectedly
git: '~/repo.git' is not a git command. See 'git --help'

What am I doing wrong? Thank you.


Solution

  • Use:

    GIT_TRACE=2 git push origin master
    

    and see what is happening to debug the issue.

    Update:

    It is trying git-receive-pack

    Try doing below:

    git config --global remote.origin.receivepack "git receive-pack"
    

    And then do the push again.

    Other things you can try:

    On the remote server setup a bare repo:

    git init --bare
    

    And then try cloning and pushing to it.