tags:

views:

212

answers:

2

I'm using Git with TortoiseGit on Windows XP, and I have a remote bare repository on Windows Vista 64bit version.

When I tried to push my local files to remote bare repository, I got the following error message.

git.exe push    "origin" master:master

git: '/Git_Repository/.git' is not a git command. See 'git --help'.

fatal: The remote end hung up unexpectedly

the arbitrary URL is : username@serverip:/Git_Repository/.git

The same arbitrary URL worked just fine while doing clone/fetch/pull.

Access from a local directory in remote machine to this bare repository has no problem either so I belive there is something wrong with my path.

I can push/pull at GitHub correctly but I was using URL provide by GitHub.

Does anyone know what's wrong with my configuration?

Here is my remote .git/config

[core]
repositoryformatversion = 0
filemode = false
bare = true
logallrefupdates = true
ignorecase = true
hideDotFiles = dotGitOnly

Here is my local .git/config

[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
fetch = +refs/heads
url = username@serverip:/Git_Repository/.git
[branch "master"]
remote = origin
merge = refs/heads/master

I edited the URL to make it more precise,but it still show the same error

Even more, no matter what I type after the serverip, it still shows the same error message

if the URL is

ssh://user@server ip/Git_Repositorywrongname/.git

then the error message

git: '/Git_Repositorywrongname/.git' is not a git command. See 'git --help'.

When user connects to the remote repository, the executed git commands are from bin directories in SSH. So I believe therer is wrong with my SSH configuration and this is why I can do git operations normally in local/ local in the remote machine.

I followed the guide in http://code.google.com/p/tortoisegit/wiki/HOWTO_CentralServerWindowsXP and linked the 4 commands

Did I miss anything?

Thanks for your reading

A: 

Try specifying the protocol explicitly (here ssh), avoiding using the ':' between the user@host part, and the local path (look at the urls described in the git fetch man page):

url = ssh://username@serverip/C:/Git_Repository/.git

In other words, avoid the scp syntax for this kind of path.

VonC
I did tried the ssh url. But the result is the same.git: '/Git_Repository/.git' is not a git command. See 'git --help'.And the correct usage for ssh url should be ssh://username@serverip/Git_Repository/.git if the directory is under C:/
Judarkness
A: 

what about

git push file:///\\<machine-ip>/<share-remote-repo>/
gath
fatal: '//<serverip>/Git_Repository/.git' does not appear to be a git repository.It doesn't work... :(I think this url is for local directory, but still thanks
Judarkness
you need to have shared the remote repo, and try not to add the .git at the end of the path.
gath
I tried to remove the .git from the end of path but it doesn't work
Judarkness