git 安装个人笔记

来源:互联网 发布:mina发送广播数据 编辑:程序博客网 时间:2024/06/17 11:25
1,去https://git-scm.com/download/linux 下载压缩包,如git-2.14.1.tar.gz
2.解压压缩包tar -zxvf git-2.14.1.tar.gz
3.进入目录cd git-2.14.1
4.输入./configure
5.输入make
6.输入make install
安装过程中出现如下错误
install -d -m 755 '/usr/local/bin'
install -d -m 755 '/usr/local/libexec/git-core'
install: cannot change permissions of `/usr/local/libexec/git-core': No such file or directory
make: *** [install] Error 1
改用 sudo make install
7.配置环境变量sudo vim /etc/profile
加入export PATH=$PATH:/usr/local/git/bin
8.生效配置文件 source /etc/profile
9.git version
git version 2.14.1



1.git clone git位置

想使用Git把档案获取到某个已存在的目录下错误
fatal: destination path ‘文件夹名’ git clone already exists and is not an empty directory

解决办法,在文件夹目录下依次执行以下命令:
    

git init


git remote add origin gitpath


git fetch


git branch master origin/master


git checkout master

接着就可以看到Git上的.bashrc出现在本地目录下