我正在尝试通过 git:// 协议克隆任何 repo 并收到此错误。
fatal: protocol error: bad line length character: SSH-
Run Code Online (Sandbox Code Playgroud)
如果我将协议更改为 https:// git 将无错误地克隆。此错误仅在 Ubuntu(12.04、12.10)中发生,在 Debian 或 Fedora 上我可以毫无问题地克隆 repo。
可能有人遇到了同样的问题并且可以帮助我,我到处搜索,但没有找到任何解决方案。
运行后sudo apt-get install git-core,我得到
Unpacking git-core (from .../git-core_1%3a1.7.4.1-3_all.deb) ...
Errors were encountered while processing:
/var/cache/apt/archives/git_1%3a1.7.4.1-3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)
因此,我按照使用 Apt-Get 安装 Git 时出错中的说明进行操作,但这也不起作用。
运行后我遇到了这个sudo dpkg --remove --force-remove-reinstreq git:
dpkg: warning: overriding problem because --force enabled:
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
(Reading database ...
dpkg: warning: files list file for package `git' missing, assuming package has no files …Run Code Online (Sandbox Code Playgroud) 有没有人从 SAMBA 网络共享成功地将 GIT 存储库克隆到 Ubuntu?
我可以通过文件管理器访问,可以通过命令行 ls,但不能克隆
此外,在git cola,qgit而gitg我看不到安装SAMBA网络共享。
我们有一个带有 Ubuntu 14.04 的本地开发服务器。我们将 SFTP 与 vsftp 和 Git 结合使用。
一些同事可以通过 SFTP 访问(没有 ssh 访问/usr/bin/nologin和 sftponly 组),而其他同事可以访问 Git 主机(不同的用户名,shell as /usr/bin/git-shell)。
我想创建以下环境:Web 前端开发人员(外部同事)的 SFTP 访问和我们后端开发人员(内部或外部同事)的 Git 访问(通过 ssh://)。
SFTP 用户已被 chroot,这非常有效。
问题在于 Git - 如果用户可以通过 ssh:// 访问 git 存储库,他们同时可以通过 SFTP 访问所有系统目录。
Git用户如何在没有SFTP访问权限的情况下在同一系统中使用SFTP和Git?
附注。我阅读了几乎整个 Google 结果,但解决方案不起作用或太旧或建议关闭 SFTP。
所以这听起来很愚蠢,但我只是想确保安全。在下面的链接中,它说终端将要求我们输入我们的姓名和电子邮件。我们是输入我们的实际姓名(如果是这样,我们的全名/带或不带空格/什么格式?)和我们的实际电子邮件,或者只是继续输入脚本:
git config --get user.name
git config --get user.email
Run Code Online (Sandbox Code Playgroud)
正如网站告诉我们的那样?
这是我所指的网站的链接:
http://installfest.railsbridge.org/installfest/configure_git
编辑: gitkraken现在具有解决冲突的合并工具。它可以从官方 gitkraken 网站上获得。所以我有一个可行的解决方案
我gitkraken用作我的 GUI-git 客户端,它没有内部合并工具,所以我需要meld用作合并工具。
当我meld在终端中运行时,它工作得很好。
但是,当我需要解决合并冲突时,gitkraken它无法打开该工具,说找不到该工具;所以我怀疑我设置.gitconfig错误。
在这里你可以找到我的一部分.gitconfig:
[merge]
tool = meld
[diff]
tool = meld
Run Code Online (Sandbox Code Playgroud)
两者都设置:
git config --global merge.tool
Run Code Online (Sandbox Code Playgroud)
和
git config --global diff.tool
Run Code Online (Sandbox Code Playgroud) 当我这样做时:
cd /home/erelsgl/git/erel-sites; git commit -m "test"
Run Code Online (Sandbox Code Playgroud)
我得到正确的:
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)
但是,当我将同一行放在我帐户的 crontab 中时,我在日志文件中看到:
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'erelsgl@erelsgl-computer')
Run Code Online (Sandbox Code Playgroud)
我在 crontab 中输入了“whoami”并得到了与外部相同的答案(“erelsgl”)。
我还尝试将推荐的“git config --global”命令放在 crontab 中(我已经在 crontab 外成功运行了它们),但这没有帮助。
我应该怎么做才能从 …
我正在使用 Ubuntu 16.04.1。
我尝试安装git:
sudo apt-get install git-all
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up runit (2.1.2-3ubuntu1) ...
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
dpkg: error processing package runit (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of git-daemon-run:
git-daemon-run depends on runit; however:
Package runit is not configured yet. …Run Code Online (Sandbox Code Playgroud) 我正在尝试让 git smudge 过滤器在 ubuntu 中工作,如此 stackoverflow 答案中所述:https : //stackoverflow.com/questions/2316677/can-git-automatically-switch-between-spaces-and-tabs
目标是在结帐时将空格转换为制表符。
在我的 .gitconfig 我有这个条目:
[filter "tabspace"]
smudge = unexpand --tabs=4 --first-only
clean = expand --tabs=4 --initial
Run Code Online (Sandbox Code Playgroud)
例如,考虑使用空格作为缩进的 lxqt-panel 存储库:https : //github.com/lxde/lxqt-panel
在 中lxqt-panel/.git/info/attributes,我启用了选项卡空间过滤器:
*.cpp filter=tabspace
*.h filter=tabspace
Run Code Online (Sandbox Code Playgroud)
根据 Stackoverflow Answer 的各种在线资源,运行git checkout HEAD -- **现在应该将所有空格转换为制表符。但是,就我而言,git 似乎完全忽略了这些设置;运行unexpand手工作品虽然。
我在这里缺少什么?
我在 Ubuntu 16.04 上使用 git 2.11.0。
我正在使用 ssh 密钥,但有一天突然停止工作。这就是我尝试克隆时得到的结果。此外,known_hosts 文件中没有任何内容。我该怎么办?
sarthak@Sarthak:~/.ssh$ git clone git@github.com:sarthmit/Andrew-Ng-ML-solutions.git
Cloning into 'Andrew-Ng-ML-solutions'...
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
sarthak@Sarthak:~/Desktop/Web Scraping$ ssh -vvv git@github.com
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "github.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to github.com [192.30.253.113] port 22.
debug1: Connection …Run Code Online (Sandbox Code Playgroud)