Tôi đã "thiết lập-a-msysgit-máy chủ-với-copssh-trên-windows", theo Tim Davis 'guide và bây giờ tôi đang học cách sử dụng lệnh git, theo sau guide của Jason Meridth và Tôi đã quản lý để có được tất cả mọi thứ làm việc tốt, nhưng bây giờ tôi không thể vượt qua lệnh push.GIT: clone hoạt động, đẩy từ xa không. Kho lưu trữ từ xa trên copssh
Tôi đã đặt máy chủ và ứng dụng khách trên cùng một máy (hiện tại), win7-x64.
Dưới đây là một số thông tin về cách mọi thứ được thiết lập:
CopSSH Folder : C:/SSH/
Local Home Folder : C:/Users/rvc/
Remote Home Folder: C:/SSH/home/rvc/ # aka /cygdrive/c/SSH/home/rvc/
git remote rep : C:/SSH/home/rvc/myapp.git # empty rep
Tại '/SSH/home/rvc/.bashrc' và 'Users/RVC/.bashrc':
export HOME=/cygdrive/c/SSH/home/rvc
gitpath='/cygdrive/c/Program Files (x86)/Git/bin'
gitcorepath='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
PATH=${gitpath}:${gitcorepath}:${PATH}
Vì vậy, nhân bản tác phẩm (tất cả mọi thứ dưới đây được thực hiện thông qua "Git Bash here": P):
[email protected] /c/code
$ git clone ssh://[email protected]:5858/SSH/home/rvc/myapp.git
Initialized empty Git repository in C:/code/myapp/.git/
warning: You appear to have cloned an empty repository.
[email protected] /c/code
$ cd myapp
[email protected] /c/code/myapp (master)
$ git remote -v
origin ssh://[email protected]:5858/SSH/home/rvc/myapp.git (fetch)
origin ssh://[email protected]:5858/SSH/home/rvc/myapp.git (push)
Sau đó, tôi tạo ra một tập tin:
[email protected] /c/code/myapp (master)
$ touch test.file
[email protected] /c/code/myapp (master)
$ ls
test.file
Cố gắng đẩy nó và nhận được lỗi này:
[email protected] /c/code/myapp (master)
$ git add test.file
[email protected] /c/code/myapp (master)
$ GIT_TRACE=1 git push origin master
trace: built-in: git 'push' 'origin' 'master'
trace: run_command: 'C:\Users\rvc\bin\plink.exe' '-batch' '-P' '5858' '[email protected]
68.1.65' 'git-receive-pack '\''/SSH/home/rvc/myapp.git'\'''
git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly
"git: '/SSH/home/rvc/myapp.git' không phải là một lệnh git. Xem 'git --help' ".. Cái gì ?!
EDIT:. RAAAGE !!
Tôi đang gặp vấn đề tương tự một lần nữa, nhưng bây giờ với ssh:
[email protected] /c/code/myapp (master)
$ GIT_TRACE=1 git push
trace: built-in: git 'push'
trace: run_command: 'ssh' '-p' '5858' '[email protected]' 'git-receive-pack '\''/
SSH/home/rvc/myapp.git'\'''
git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly
.
tôi đã thử GUI đẩy, và hiển thị cùng một thông điệp
git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'.
Pushing to ssh://[email protected]:5858/SSH/home/rvc/myapp.git
fatal: The remote end hung up unexpectedly
Dưới đây là các dòng .bashrc:
C: \ Users \ rvc.bashrc (Tôi nghĩ rằng đây chỉ được sử dụng bởi Cygwin/git bash):
export HOME=/c/SSH/home/rvc
gitpath='/c/Program Files (x86)/Git/bin'
gitcorepath='/c/Program Files (x86)/Git/libexec/git-core'
export GIT_EXEC_PATH=${gitcorepath}
PATH=${gitpath}:${gitcorepath}:${PATH}
C: \ SSH \ home \ rvc.bashrc (.. và điều này được sử dụng khi git kết nối qua ssh đến máy chủ "từ xa"):
export HOME=/c/SSH/home/rvc
gitpath='/cygdrive/c/Program Files (x86)/Git/bin'
gitcorepath='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
export GIT_EXEC_PATH=${gitcorepath}
PATH=${gitpath}:${gitcorepath}:${PATH}
EDIT 2: Một số thông tin bổ sung:
[email protected] /c/code/myapp (master)
$ ssh -p 5858 [email protected] git-receive-pack /SSH/home/rvc/myapp.git
git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'.
EDIT 3:
[email protected] /c/code/myapp (master)
$ git push --receive-pack='git receive-pack' ssh://[email protected]:5858/SSH/home/rvc/myapp.git --a
ll
Counting objects: 3, done.
Writing objects: 100% (3/3), 202 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://[email protected]:5858/SSH/home/rvc/myapp.git
* [new branch] master -> master
Có này đã làm các trick ??
git push đang chạy 'git-receive-pack' và nó phải là 'git receive-pack'?
Phiên bản git của tôi là 'git phiên bản 1.7.0.2.msysgit.0 '