2019年11月

阿里云 TortoiseGit 拉取代码报错

git.exe pull --progress -v --no-rebase "origin"

fatal: protocol error: bad line length character: Welc

git did not exit cleanly (exit code 1) 


修改 TortoiseGit 设置 >> 网络,默认的 SSH 客户端:
"C:\Program Files\TortoiseGit\bin\TortoiseGitPlink.exe"

改成win下git默认的
"C:\Program Files\Git\usr\bin\ssh.exe"

{9BB7F38C-E092-4F02-B46F-5F715CFE9AB6}_20191104192239.jpg

https://github.com/git-for-windows/git/wiki/Symbolic-Links

Symbolic Links
Clemens Buchacher edited this page on 26 Jul · 20 revisions

Short version: there is no exact equivalent for POSIX symlinks on Windows, and the closest thing is unavailable for non-admins by default. Therefore, symlink emulation support is switched off by default and needs to be configured by you, the user, via the core.symlinks=true config setting.
Background

Starting with Windows Vista, there is support for symbolic links. These are not your grandfather's Unix symbolic links; They differ in quite a few ways:

Symbolic links are only available on Windows Vista and later, most notably not on XP
You need the SeCreateSymbolicLinkPrivilege privilege, which is by default assigned only to Administrators and guarded by UAC, but can be assigned to other users or user groups (see below).
Symbolic links on remote filesystems are disabled by default (call fsutil behavior query SymlinkEvaluation to find out)
Symbolic links will only work on NTFS, not on FAT nor exFAT
Windows' symbolic links are typed: they need to know whether they point to a directory or to a file (for this reason, Git will update the type when it finds that it is wrong)
Many programs do not understand symbolic links

For those reasons, Git for Windows disables support for symbolic links by default (it will still read them when it encounters them). You can enable support via the core.symlinks config variable, e.g. when cloning:

git clone -c core.symlinks=true

Creating symbolic links

By default, the ln -s command in Git Bash does not create symbolic links. Instead, it creates copies.

To create symbolic links (provided your account has permission to do so), use the built-in mklink command, like so:

mklink /d this-link-points-to c:\that-directory
mklink this-link-points-to c:\that-file

Allowing non-administrators to create symbolic links

The privilege of Create symbolic links can be assigned using local policy editors (or via policies from Active Directory in case of domain accounts). Home Editions of Windows do not have these policy editors, but the freely available Polsedit can be used on these editions.

Local Group Policy Editor: Launch gpedit.msc, navigate to Computer Configuration - Windows Settings - Security Settings - Local Policies - User Rights Assignment and add the account(s) to the list named Create symbolic links.

Local Security Policy: Launch secpol.msc, navigate to Local Policies - User Rights Assignment and add the account(s) to the list named Create symbolic links.

Polsedit: Launch polseditx32.exe or polseditx64.exe (depending on your Windows version), navigate to Security Settings - User Rights Assignment and add the account(s) to the list named Create symbolic links.

Note that regardless of privilege assignment, members of the Administrators group will also require UAC elevation (see the full details in the Access Token Changes section in this document on UAC). Since Windows 10 version 1703 (Creators Update), enabling Developer Mode will disable this restriction and allow creating symlinks without UAC elevation (although Git for Windows still requires UAC elevation up to and including v2.13.0).
Creating directory junctions

Directory junctions can be created by non-administrator users by default. Therefore, they are a popular alternative to symbolic links. To create a directory junction, use the mklink command with the /j option:

mklink /j this-link-points-to c:\that-directory

1.安装 git,首先去 git 官网下载git,https://git-scm.com/downloads
2.安装 TortoiseGit,下载地址https://tortoisegit.org/download
3.从程序目录启动“Git Bash”
4.键入命令:ssh-keygen -t rsa -C "email@email.com","email@email.com"是你的 github 账号
5.此时,你的 C:\Users\admin.ssh 这个路径下会生成两个文件:id_rsa 和 id_rsa.pub
6.用记事本打开 id_rsa.pub 文件,复制内容,在 github.com 的网站上到ssh密钥管理页面,添加新公钥,随便取个名字,内容粘贴刚才复制的内容。


私钥文件转换PPK文件

  1. 运行puttygen
  2. 列表项目
  3. 点击Conversions菜单项中的Import key, 列表项目选择在 Linux VPS下生成的id_rsa文件
  4. 在puttygen的界面上点击Save private key按钮就可以把私钥转换为ppk的格式了

- 阅读剩余部分 -