2

I've got two machines running cygwin ssh with msysgit. I've cloned a git repository from my desktop to my laptop as described in 'X' does not appear to be a git repository (I'm sure the path is correct). This leaves me with a .git/config as follows:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = GitServer:D:/Projects/TheProject
[branch "master"]
    remote = origin
    merge = refs/heads/master

The clone worked great. git pull origin works great. But if I try to "git push origin master" I get the following error:

$ git push origin master
MyUser@TheDesktop's password:
git: 'D:/Projects/TheProject' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly

Any ideas about a fix for this?

Community
  • 1
  • 1
Jake Stevenson
  • 3,009
  • 6
  • 35
  • 40
  • Why are you using msysgit from Cygwin? Cygwin has its own git package, which does work with Cygwin paths. Conversely, msysgit should be happier in MSYS. – ak2 Apr 26 '11 at 19:39
  • I had many issues with cygwin's git-svn, which is what the desktop machine uses to fetch the repo from my company's svn server. I'm running msysgit inside of cygwin because the overall environment is more complete. – Jake Stevenson Apr 26 '11 at 19:55

5 Answers5

2

http://www.cygwin.com/cygwin-ug-net/using.html#cygdrive recommends against using the "D:/" syntax and suggests using "/cygdrive/d/" instead.

It looks like cygwin doesn't have chsh but you could set your shell to git-shell manually in your cygwin.bat.

clee
  • 10,943
  • 6
  • 36
  • 28
1

First run this on client: git config --global remote.origin.receivepack "git receive-pack"

CD into your local repository: cd mylocalrepo

Assuming server side path == c:\gitpub\myproj.git, then to pull/push to server git fetch user@remoteserver.com:c:/gitpub/myproj.git master git push user@remoteserver.com:c:/gitpub/myproj.git master

Of course you can add a remote shortcut: git remote add myremote user@remoteserver.com:c:/gitpub/myproj.git

and then: git fetch myremote master git push myremote master

For more information on setup of cygwin/ssh server, here's a post I wrote that discusses setting up a shared GIT repository on a Windows Server instance running in the Amazon EC2 cloud:

http://cacheattack.blogspot.com/2012/05/installing-git-server-on-amazon-ec2.html

cache
  • 11
  • 1
1

You can use cygwin urls : use /d/Projects/TheProject instead of D:/Projects/TheProject

Bruce
  • 7,094
  • 1
  • 25
  • 42
1

The accepted answer to this question fixed it for me, specifically this:

git config --global remote.origin.receivepack "git receive-pack"
Community
  • 1
  • 1
Jon M
  • 11,669
  • 3
  • 41
  • 47
0

I've switched to using cygwin's version of git, as mentioned in ak2's comment. It all works now.

But I do remember why I avoided cygwin git in the first place... it often (several times a day) errors when using git svn. I end up having to kill off all my cygwin processes and running "ash rebaseall" to fix it, or rebooting my machine. It's very frustrating.

Jake Stevenson
  • 3,009
  • 6
  • 35
  • 40