首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MsysGit配置步骤问题

MsysGit配置步骤问题
EN

Stack Overflow用户
提问于 2013-12-26 08:10:17
回答 1查看 325关注 0票数 1

请帮助我修复git配置步骤。

我无法连接到远程git存储库,每次尝试连接到远程裸git存储库时都会出现错误,“似乎不是git存储库”和“无法从远程存储库读取”

以下是我的配置步骤:-

预置

  1. 下载Cygwin
  2. 下载msysgit
  3. 下载TortiseGIT
  4. 下载PuTTY安装程序

步骤1- Cygwing配置

代码语言:javascript
复制
Host Configuration of SSH
  1. 在管理员模式下运行cygwin
  2. mkpasswd -l > /etc/passwd
  3. mkgroup -l > /etc/group
  4. 添加系统环境变量Variable=>路径=> C:\DevTools\cygwin\root\bin和C:\DevTools\cygwin 64\bin
  5. 如果sshd服务正在运行,那么停止它=>网停止sshd
  6. ssh-host-config -您将看到脚本生成一些默认文件,然后提示您是否要启用“特权分离”。默认情况下,它是在其他系统上的OpenSSH标准安装中打开的,所以继续对提示说“是”。
  7. 净启动sshd
  8. 从窗口出口 SSH的用户配置
  9. 在没有管理员的情况下运行cygwin,只需双击它。
  10. ssh-user-config
  11. 您将被要求为您的用户帐户创建特定的密钥,向SSH2 RSA输入“yes”,并为"no“键入其他密钥。
  12. 就这样!你们都配置好了。如果您想测试您的配置ssh -v localhost
  13. 在authorized_keys中创建一个文件"id_rsa.pub“,并将公钥文件”id_rsa.pub“数据粘贴到一行中并保存。 从本地系统到服务器的访问
  14. 在本地系统上安装Putty
  15. 将id_rsa文件复制到本地计算机。
  16. 运行puttygen并加载此键并保存为.ppk。
  17. 在选美中添加私钥.ppk。
  18. 用22端口运行Putty。

6.提示输入用户名和密码。

步骤2-配置msysgit.

1.安装好后,您现在有2个窗口,我将其命名为1.gitBash(在资源管理器中的文件/文件夹上右击鼠标)和2.启动->程序-> cygwinSSH ->启动Unix。

  1. 最后,转到GIT安装目录-C:\DevTools\Git\libexec\git-core中的Git-Core文件夹,并复制文件=> git.exe、Git-接收-Pack.exe、Git-上载-存档. one和Git-上载-Pack.exe,并将这些文件粘贴到C中:\DevTools\cygwin\root\bin\并复制多个文件C:\DevTools\Git\bin\libiconv 2.dll并粘贴到C中:\DevTools\cygwin\root\bin\bin。
  2. 修改用户环境

代码语言:javascript
复制
1. The problem with SSH is that it sets its $HOME environment to the c:\users\  or c:\Documents and Settings\ variable – and GIT looks for authorized\_keys in this    folder. Of course, we don’t want this we setup our Server Environment in the    C:\DevTools\cygwin\root\Home\.ssh and so we want GIT to look for keys in there. 
2. Open Windows Explorer – go into C:\DevTools\cygwin\root\Home\\ and open    the .bashrc file using a text editor (Aside: Be sure not to attempt to format  this file as it has Unix Encodings NOT Dos encodings – i.e. just open it in a text editor and   don’t use another viewer unless you want encoding errors – you don’t need to read the text  in this file if you are following these instructions to a tee.) 
3. Put the Cursor at the beginning of the .bashrc file and use CTRL+F to find the following     text - bashrc file. 

4.在文本.bashrc file#之后(在英镑之后加上空格)-粘贴=/c/DevTools/cygwin64 64/home/。

  1. 确保在粘贴之前和之后有一个“空格”,即.bashrc file#export home=/c/DevTools/cygwin64 64/home/

代码语言:javascript
复制
1. Save this file and close it. 
2. Copy this file and navigate to your windows assigned home directory (Aside: GIT will     still be looking for your path in this directory so we need to set to refer to our  C:\DevTools\cygwin\root\home\\directory instead) 
3. Paste this in your c:\users\ or c:\Documents and Settings\ – so  it now has c:\users\.bashrc for example. 
4. Open both a Git Bash and a Unix Bash Shell – Unix    Bash shell 
5. Type echo $HOME – into both – they should both spit out – /home/ 
6. If one does not – you need to set it via cmd-  export  HOME=/c/DevTools/cygwin64/home/
7. Set Following sytem Environment Variable =>
代码语言:javascript
复制
    1. CYGWIN\_HOME =C:\DevTools\cygwin64\
    2. GIT\_SSH=C:\DevTools\TortoiseGit\bin\TortoiseGitPLink.exe
    3. Path=C:%CYGWIN\_HOME%\bin C:\DevTools\Git\cmd C:\DevTools\TortoiseGit\bin C:\DevTools\Git\bin
    4. SVN\_SSH=C:\DevTools\TortoiseGit\bin\TortoiseGitPLink.exe

步骤3-使用GIT和Plink

  1. 导航到D:\并创建一个名为Git_Repository.git的新目录
  2. 选择Git Bash
  3. goto文件夹D:\Git_repository.git并执行cmd=> git --裸init
  4. 现在您将看到一个(裸:主人)出现并可以关闭窗口。
  5. 现在是时候将这个存储库克隆到本地开发环境中,并最终开始使用GIT了。
  6. 导航到您希望拥有本地存储库的地方--在我的例子中是D:\SCM_REPO\
  7. 右键单击此目录并点击Git Clone
  8. 输入您的URL作为ssh://GauravA@192.168.248.58:22/d/Git_repository.git,没有必要加载Putty键,因为我们已经使用选美完成了这一点。命中确定并得到以下错误

!错误信息

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-27 10:04:08

我做到了!

使用URL:

代码语言:javascript
复制
git push GauravA@192.168.248.58:D:/Git_repo.git

在IP地址之后,不需要在URL和端口号开始时使用ssh://

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20781431

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档