标签: git-bash

使用forward_agent选项从Windows部署Capistrano:"从身份验证套接字读取响应长度时出错."

我正在尝试使用Capistrano部署项目.我的开发机器正在运行Windows 7; 我正在部署的服务器是Linux.

在deploy.rb脚本中,设置以下内容:

ssh_options[:forward_agent] = true
Run Code Online (Sandbox Code Playgroud)

Capistrano脚本从本地运行git命令开始,此时我被提示输入SSH密钥的密码:

* executing `deploy:update_code'
executing locally: "git ls-remote git@github.com:pathto/gitproject.git develop"
Enter passphrase for key '/c/Users/Sam/.ssh/id_rsa':
command finished in 6999ms
Run Code Online (Sandbox Code Playgroud)

(我可能已经从中看到了真正的git路径.)

我输入我的密码,这很好用.然而,Capistrano然后尝试在远程机器上做类似的事情(在下面重命名为staging-server.com)并且我得到一个错误 - 请参阅此提取的最后一行:

[staging-server.com] executing command
[staging-server.com] sh -c 'git clone git@github.com:pathto/gitproject.git /home/perstest/releases/20120412074500 && cd
/home/perstest/releases/20120412074500 && git checkout -b deploy 50eaf06d06d66fd20c3e55038276f420d8c308a8 && (echo 50eaf06d06d66fd20c3e55038
276f420d8c308a8 > /home/perstest/releases/20120412074500/REVISION)'
 ** [staging-server.com :: out] Initialized empty Git repository in /home/perstest/releases/20120412074500/.git/
 ** [staging-server.com :: err] Error reading response length from authentication socket.
Run Code Online (Sandbox Code Playgroud)

如果我在deploy.rb中注释掉forward_agent行,则此安装成功,可能是使用部署服务器本身的密钥.

我的SSH密钥似乎正在工作 - 毕竟,最初的git命令工作,我可以在git …

capistrano ssh-agent git-bash

12
推荐指数
1
解决办法
6213
查看次数

在Windows上使用Git Bash进行X会话?

我在Windows上使用Git Bash.我已经使用Git Bash将SSH连接到UNIX机器并尝试使用GUI运行程序.我收到消息:检测到LINUX/UNIX系统,但无法访问X11显示.

我有X-Win 32(商业).我也使用了Xming,它就像X-Win 32的免费版本,但在某些图形方面存在问题.

有没有办法让这个远程系统通过X-Win 32或Xming或通过任何方式访问我的X11显示器?

我只想在UNIX机器上运行带有GUI弹出的程序,当通过Windows上的Git Bash将SSH连接到该机器时.

我也安装了PuTTY和Secure Shell Client,但是它更喜欢只用Git Bash工作,因为它需要更少的按钮来按ssh到其他机器.

如果不能让这个工作在Git Bash上我想让它与PuTTY合作(Secure Shell Client很好,但已经永久停止了更新).

git x11 user-interface putty git-bash

12
推荐指数
3
解决办法
1万
查看次数

Windows 7 x64上的git bash自动完成缓慢

我有两台机器,其中git bash auto complete非常慢.当我点击标签时,文件名可能需要8到10秒才能完成.只有当auto complete是git命令的一部分时,才会发生这种情况.自动完成cd工作正常.git命令的实际执行运行正常.

我在用 git version 1.8.3-preview20130601

$ git count-objects -vH
count: 9
size: 10.23 KiB
in-pack: 2488
packs: 1
size-pack: 18.68 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes
Run Code Online (Sandbox Code Playgroud)

可能是什么导致了这个?有没有可能的解决办法?

编辑:我更新到Git (version 1.8.4-preview20130916),问题仍然存在.我注意到在ConEmu中运行bash shell时,在长时间停顿期间显示在底部的命令是uniq.exe.似乎对可执行文件的调用正在扼杀时间.

编辑:更新git version 1.9.0.msysgit.0已缓解了大部分问题.延迟现在只有1到2秒.其他命令cd几乎是即时的(<0.5s).我也不会再看到uniq.exe跑步了sh.exe.

git bash zsh git-bash

12
推荐指数
2
解决办法
4533
查看次数

如何在git-svn中设置上游分支?

在通常的git存储库上工作时,本地分支通常会跟踪相应的远程上游分支.通过这种方式,我可以很容易地看到,无论我是在我的上游分支的前面还是后面,因此我需要推或拉来使它们同步.此外我的提示立即显示此状态,这非常方便.

现在我正在使用SVN存储库git-svn.我用--prefix=svn的克隆,因此git branch -r列出svn/trunk作为远程分支,但(虽然git svn rebase没有问题作品)它没有被配置为用于我的主分支的上游分支.

我尝试手动设置跟踪信息,但失败了:

$ git branch -r
  svn/trunk
$ git branch --set-upstream-to=svn/trunk
fatal: Cannot setup tracking information; starting point 'svn/trunk' is not a branch.
Run Code Online (Sandbox Code Playgroud)

有没有办法跟踪svn上游分支?

还有其他一些简单的方法可以知道我是领先还是落后于那个分支?(看着gitk --all目前我所知道的唯一方式.)

有没有办法让我的(bash __git_ps1)提示显示信息?


$ git --version
git version 1.9.0.msysgit.0
Run Code Online (Sandbox Code Playgroud)

svn git git-svn msysgit git-bash

12
推荐指数
2
解决办法
3714
查看次数

节点命令在Windows上的git bash终端中不起作用

我正在尝试node在我的git bash终端中运行该命令.当我运行node命令时,按Enter键时没有任何反应.将$消失,它只是离开上没有下一行闪烁的光标>.

My-PC MINGW32 /
$ node -v
v4.5.0

My-PC MINGW32 /
$ where node
C:\Program Files\nodejs\node.exe

My-PC MINGW32 /
$ node
_
Run Code Online (Sandbox Code Playgroud)

有人能告诉我这个问题是什么吗?

谢谢!!

windows node.js git-bash

12
推荐指数
1
解决办法
7795
查看次数

如何在Windows中更改Git终端的标题?

我在Windows 10中工作,通常我最多打开5个CMD窗口.我这样做是因为我需要使用不同的数据运行相同的应用程序,并且如果抛出任何异常则继续监视.

我更改了窗口的标题(使用title命令)并使用数字而不是默认文本,以便轻松识别我正在使用的窗口,并能够使用Alt+Tab(我的工作方式示例)识别和更改它们我的CMD窗口)

最近我开始使用Git,我真的很喜欢Windows的Git Bash终端.我想使用Git Bash终端,就像我使用CMD窗口一样,但我找不到任何方法来更改窗口标题.我搜索了一下,发现这些说明和其他一些(我不能粘贴,因为我不允许发布超过两个链接),但它似乎只能通过设置不同的默认标题.我想随时将窗口标题更改为我选择的任何自定义文本.

这可能吗?是否有像titleGit Bash 这样的命令?

windows git bash titlebar git-bash

12
推荐指数
4
解决办法
6272
查看次数

Git说“自动合并失败”,是什么意思?

我试图合并两个分支,这就是我所做的和发生的事情:

Abdulla (Master) new-git-project1
$ git merge sidebar
Auto-merging index.html
CONFLICT (content): Merge conflict in index.html
Automatic merge failed; fix conflicts and then commit the result.
Abdulla (Master *+|MERGING) new-git-project1
$ git merge sidebar
error: Merging is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
Run Code Online (Sandbox Code Playgroud)

我是新手,所以我能得到简单的答案。

git git-bash

12
推荐指数
2
解决办法
2万
查看次数

在WSL上运行Debian和Ubuntu上的git命令对于大型项目来说真的很慢

我们有一个非常大的项目,总共有近15000次提交.我9.3使用WSL在我的Windows机器上运行Debian .我的git版本是2.17.0.

当我运行诸如此类的命令时git status,至少需要20秒才能完成.即使没有做出任何改变.

我尝试了多个旧版本的git甚至尝试过Ubuntu,但我仍然遇到了相同的结果.我已尝试在这里和其他网站上运行来自各个帖子的一堆命令,但它们都没有奏效.

有趣的事情:当我cmd.exe在Windows上打开或Git Bash时,运行只需不到一秒钟git status.

可能是什么导致了这个?我该怎么做才能解决这个问题?

git git-bash windows-subsystem-for-linux

12
推荐指数
4
解决办法
4172
查看次数

即使在签出到另一个分支后也无法删除本地分支

我正在尝试删除我的本地分支并尝试了我在这里找到的大多数解决方案,即签出到另一个分支然后运行git branch -D (or -d) <my_branch>。我尝试过,但仍然收到相同的错误,指出“无法删除在“my_path”签出的分支“my_branch”

我是如何陷入这种情况的:我通过执行git worktree add -b branch_name ../project_name develop. 然后我意识到我想更改我的分支名称,因此我首先使用 删除了整个目录rm- rf。现在 my_path 指向已删除的目录,所以我不知道现在该怎么办。帮助将不胜感激。我使用 Git Bash 在 Windows 7 上运行

我尝试过的事情:

  1. 重新启动我的电脑
  2. 重新安装 Git Bash
  3. 结帐到另一个分支并git branch -d尝试git branch -D

错误截图: git分支删除错误 (virtualBDD) 是我的虚拟环境。你可以忽略这一点。

git branch git-bash

12
推荐指数
3
解决办法
2万
查看次数

使用 git bash 时权限被拒绝

我想知道 Git bash 开始时的 Git 错误是什么?

chmod: changing permissions of '/dev/mqueue': Permission denied
ln: failed to create symbolic link '/etc/mtab': Permission denied
'C:\WINDOWS\system32\drivers\etc\hosts' -> '/etc/hosts'
/usr/bin/cp: cannot create regular file '/etc/hosts': Permission denied
'C:\WINDOWS\system32\drivers\etc\protocol' -> '/etc/protocols'
/usr/bin/cp: cannot create regular file '/etc/protocols': Permission denied
'C:\WINDOWS\system32\drivers\etc\services' -> '/etc/services'
/usr/bin/cp: cannot create regular file '/etc/services': Permission denied
'C:\WINDOWS\system32\drivers\etc\networks' -> '/etc/networks'
/usr/bin/cp: cannot create regular file '/etc/networks': Permission denied
rm: cannot remove '/etc/post-install/01-devices.post': Permission denied
rm: cannot remove '/etc/post-install/03-mtab.post': Permission denied
rm: cannot …
Run Code Online (Sandbox Code Playgroud)

git permissions git-bash

12
推荐指数
3
解决办法
4471
查看次数