1. 下载安装
项目首页:https://github.com/vim/vim
|
1 2 3 4 |
git clone https://github.com/vim/vim.git cd vim/src ./configure --prefix=/usr/local/vim-8.0 make && make install |
1. 下载安装
项目首页:https://github.com/vim/vim
|
1 2 3 4 |
git clone https://github.com/vim/vim.git cd vim/src ./configure --prefix=/usr/local/vim-8.0 make && make install |
问题的原因是因为编译时系统缺少 curl 组件,根据系统安装: ubuntu: apt-get install curl libcurl3 libcurl4-openssl-dev centos: yum install curl-devel 然后重新编译安装 git: [crayon-6953b90e6 ... 阅读更多
github 属于境外网站,大部分时候访问速度都不到 100K,克隆大仓库时相当耗时。比较好的解决办法就是通过科学上网来进行代理,加快访问速度。 注:本文不提供科学上网的方式,只提供 git 设置代理的方式。 设置方法
|
1 2 3 4 5 6 7 |
# 设置代理 git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080' # 取消代理 git config --global --unset http.proxy git config --global --unset https.proxy |
或者 [crayon- ... 阅读更多
0x01 问题描述 使用 git mv 重命名文件时出现以下错误信息:
|
1 |
fatal: bad source, source=go/src/handle/add.go, destination=go/src/handle/add.go |
0x02 问题原因 源文件 go/src/handle/add.go 在本地已经被删除了,但是 git 库中并没有被删除,所以重命名该文件的上级目录时产生了冲突。 通过 ... 阅读更多
一、创建 github 仓库 点击浏览器右上角的+号,选择 New repository 开始创建一个仓库: 进入创建仓库页面,设置仓库的名字,下面可以选择自动创建一个 README.MD 文件: 创建成功后会跳转到仓库首页,点击 Clone or download 会出现该仓库的地址,浏览器当前地址栏中的地址也是 ... 阅读更多
一、配置用户信息和 ssh key 配置 user.email 以及 user.name:
|
1 2 |
git config --global user.name "maqian" |
生成公私密钥:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): # 文件的生成目录 Created directory "/root/.ssh". Enter passphrase (empty for no passphrase): # 密码,可以为空 Enter same passphrase again: # 确认密码 Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: c2:4f:68:c6:14:8a:20:cf:78:72:a4:23:df:f7:cb:5c maqian@dyxmq.cn The key"s randomart image is: +--[ RSA 2048]----+ |o . . | |.B . . . | |* * . . | |.* . + . | | . . O S | | + = | | o E | | o o | | + | +-----------------+ |
二、上传密钥到 github 上面生成了两个密钥文件,默认位于~/.s ... 阅读更多
一、 Git 提交代码的流程 git 中一个完整的代码提交流程为: 在工作区写好要提交的代码文件,然后使用 git add 命令把文件到寄存区,确认代码后使用 git commit 提交到版本库。 二、提交代码到寄存区 git add 用于把工作区的文件提交到寄存区中,后面跟上需要提交的文件,例如 git add a ... 阅读更多
一、概述 学习 git 的第一步,肯定是要知道如何创建版本库,但是在这之前,还要搞清楚的一组概念是 git 中的工作区、寄存区和版本库。 工作区:工作区是我们的项目工作目录,也是 git 初始化时的目录,将来所有的代码文件都保存在这个目录中。 寄存区:在工作区完成代码编辑后,首先要使用 add 命令把代码提交到寄存 ... 阅读更多
一、概述 Git 的默认配置信息保存在~/.gitconfig 文件下,初始化的时候为空,根据需要添加。 二、配置用户信息 这里的用户信息就相当于 QQ 或是微信里的用户名一样,标志用户的身份。 需要配置的是 name 和 email:
|
1 2 |
git config --global user.name "maqian" git config --global user.email maqian@dyxmq.cn |
注意--g ... 阅读更多
一、下载安装包 Git 发布地址,目前最新版 2.15:wget https://github.com/git/git/archive/v2.15.0.tar.gz 网速慢的话可以搞个代理,或者用迅雷下载。 二、安装依赖库
|
1 2 |
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel yum install gcc-c++ perl-ExtUtils-MakeMaker |
三、解压和安装 ... 阅读更多