Git 2.8.x 安装和配置--Linux篇

本文详细介绍了如何在CentOS 6.8 64位系统上安装Git 2.8.0版本,包括关闭防火墙和Selinux、下载安装Git、验证安装等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

阅读目录:

1. 简介

2. 关闭防火墙和Selinux

3. 下载并安装Git 2.8.x版本

4. 验证

5.说明

1. 简介

  • Git是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。
  • Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。 Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。<!-- 百度百科 -->

2. 关闭防火墙和Selinux

        Linux的防火墙是咱们新手的噩梦,很多情况会出现能ping通,但是访问不了Web页面。所以开始就干掉它!

    2.1 关闭防火墙

    [root@localhost ~]# /etc/init.d/iptables stop
    iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
    iptables: Flushing firewall rules:                         [  OK  ]
    iptables: Unloading modules:                               [  OK  ]

    2.2 开机自动关闭防火墙

    [root@localhost ~]# chkconfig iptables off

    2.3 查看Selinux状态

    [root@localhost ~]# sestatus
    SELinux status: enabled 
    SELinuxfs mount: /sys/fs/selinux 
    SELinux root directory: /etc/selinux 
    Loaded policy name: targeted 
    Current mode: enforcing 
    Mode from config file: enforcing 
    Policy MLS status: enabled 
    Policy deny_unknown status: allowed 
    Max kernel policy version: 28

    2.4 关闭selinux

    [root@localhost ~]# vi /etc/selinux/config 

修改 SELINUX=disabled 
注:永久开启->改成:SELINUX=enforcing

3. 下载并安装Git 2.8.x版本

注:为了方便管理,创建一个文件夹专门放所需软件

    [root@localhost /]# mkdir developer
    [root@localhost /]# cd developer

    3.1 安装前的环境准备

    [root@localhost developer]# yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils- MakeMaker

    3.2 下载Git 2.8.x

    [root@localhost developer]# wget https://github.com/git/git/archive/v2.8.0.tar.gz

    3.3 解压Git 2.8.x

    [root@localhost developer]# tar -zxvf v2.8.0.tar.gz

    3.4 进入Git目录

    [root@localhost developer]# cd git-2.8.0

   3.5 编译到/usr/local目录下

    [root@localhost git-2.8.0]# make prefix=/usr/local/git all

    3.6 安装到/usr/local目录下

    [root@localhost git-2.8.0]# make prefix=/usr/local/git install

    3.7 配置Git的环境变量

    [root@localhost git-2.8.0]# vim /etc/profile

    在文本末最后一行添加如下代码:

export PATH=$PATH:/usr/local/git/bin

保存退出。

   3.8 使配置立即生效

    [root@localhost git-2.8.0]# source /etc/profile

4. 验证

    验证Git是否成功

    [root@loubobooo git-2.8.0]# git --version
    git version 2.8.0

    出现Git版本号,便算成功。

    git version 2.8.0

5. 说明

    说明:本次使用

       操作系统:CentOS 6.8 64位

       Git版本:2.8.0

下一篇:Git使用细节--Windows篇:

        https://my.oschina.net/u/3209432/blog/1600785

转载于:https://my.oschina.net/loubobooo/blog/1600671

ii udev 249.11-0ubuntu3.16 amd64 /dev/ and hotplug management daemon ii udisks2 2.9.4-1ubuntu2.2 amd64 D-Bus service to access and manipulate storage devices ii ufw 0.36.1-4ubuntu0.1 all program for managing a Netfilter firewall ii unattended-upgrades 2.8ubuntu1 all automatic installation of security upgrades ii uncrustify 0.72.0+dfsg1-2 amd64 C, C++, ObjectiveC, C#, D, Java, Pawn and VALA source code beautifier ii unixodbc-common 2.3.9-5ubuntu0.1 all Common ODBC configuration files ii update-inetd 4.51 all inetd configuration file updater ii update-manager 1:22.04.22 all GNOME application that manages apt updates ii update-manager-core 1:22.04.22 all manage release upgrades ii update-notifier 3.192.54.8 amd64 Daemon which notifies about package updates ii update-notifier-common 3.192.54.8 all Files shared between update-notifier and other packages ii upower 0.99.17-1 amd64 abstraction for power management ii usb-creator-common 0.3.13 all create a startup disk using a CD or disc image (common files) ii usb-creator-gtk 0.3.13 all create a startup disk using a CD or disc image (for GNOME) ii usb-modeswitch 2.6.1-3ubuntu2 amd64 mode switching tool for controlling "flip flop" USB devices ii usb-modeswitch-data 20191128-4 all mode switching data for usb-modeswitch ii usrmerge 25ubuntu2 all Convert the system to the merged /usr directories scheme ii va-driver-all:amd64 2.14.0-1 amd64 Video Acceleration (VA) API -- driver metapackage ii vdpau-driver-all:amd64 1.4-3build2 amd64 Video Decode and Presentation API for Unix (driver metapackage) ii vtk9 9.1.0+really9.1.0+dfsg2-3build1 amd64 Binaries for VTK9 ii wamerican 2020.12.07-2 all American English dictionary words for /usr/share/dict ii wbritish 2020.12.07-2 all British English dictionary words for /usr/share/dict ii wget 1.21.2-2ubuntu1.1 amd64 retrieves files from the web ii whiptail 0.52.21-5ubuntu2 amd64 Displays user-friendly dialog boxes from shell scripts ii whoopsie-preferences 23 amd64 System preferences for error reporting ii wireless-regdb 2024.10.07-0ubuntu1~22.04.1 all wireless regulatory database ii wireless-tools 30~pre9-13.1ubuntu4 amd64 Tools for manipulating Linux Wireless Extensions ii x11-common 1:7.7+23ubuntu2 all X Window System (X.Org) infrastructure ii xbrlapi 6.4-4ubuntu3 amd64 Access software for a blind person using a braille display - xbrlapi ii xcvt 0.1.1-3 amd64 VESA CVT standard timing modelines generator ii xdg-dbus-proxy 0.1.3-1 amd64 filtering D-Bus proxy ii xdg-desktop-portal 1.14.4-1ubuntu2~22.04.2 amd64 desktop integration portal for Flatpak and Snap ii xdg-desktop-portal-gnome 42.1-0ubuntu2 amd64 GNOME portal backend for xdg-desktop-portal ii xdg-desktop-portal-gtk 1.14.0-1build1 amd64 GTK+/GNOME portal backend for xdg-desktop-portal ii xdg-user-dirs 0.17-2ubuntu4 amd64 tool to manage well known user directories ii xdg-user-dirs-gtk 0.10-3build2 amd64 tool to manage well known user directories (Gtk extension) ii xdg-utils 1.1.3-4.1ubuntu3~22.04.1 all desktop integration utilities from freedesktop.org ii xfonts-encodings 1:1.0.5-0ubuntu2 all Encodings for X.Org fonts ii xfonts-utils 1:7.7+6build2 amd64 X Window System font utility programs ii xinput 1.6.3-1build2 amd64 Runtime configuration and test of XInput devices ii xkb-data 2.33-1 all X Keyboard Extension (XKB) configuration data ii xml-core 0.18+nmu1 all XML infrastructure and XML catalog file support ii xorg 1:7.7+23ubuntu2 amd64 X.Org X Window System ii xorg-docs-core 1:1.7.1-1.2 all Core documentation for the X.org X Window System ii xorg-sgml-doctools 1:1.11-1.1 all Common tools for building X.Org SGML documentation ii xserver-xorg 1:7.7+23ubuntu2 amd64 X.Org X server ii xserver-xorg-core 2:21.1.4-2ubuntu1.7~22.04.15 amd64 Xorg X server - core server ii xserver-xorg-input-all 1:7.7+23ubuntu2 amd64 X.Org X server -- input driver metapackage ii xserver-xorg-input-libinput 1.2.1-1 amd64 X.Org X server -- libinput input driver ii xserver-xorg-input-wacom 1:1.0.0-3ubuntu1 amd64 X.Org X server -- Wacom input driver ii xserver-xorg-legacy 2:21.1.4-2ubuntu1.7~22.04.15 amd64 setuid root Xorg server wrapper ii xserver-xorg-video-all 1:7.7+23ubuntu2 amd64 X.Org X server -- output driver metapackage ii xserver-xorg-video-amdgpu 22.0.0-1ubuntu0.2 amd64 X.Org X server -- AMDGPU display driver ii xserver-xorg-video-ati 1:19.1.0-2ubuntu1 amd64 X.Org X server -- AMD/ATI display driver wrapper ii xserver-xorg-video-fbdev 1:0.5.0-2build1 amd64 X.Org X server -- fbdev display driver ii xserver-xorg-video-intel 2:2.99.917+git20210115-1 amd64 X.Org X server -- Intel i8xx, i9xx display driver ii xserver-xorg-video-nouveau 1:1.0.17-2build1 amd64 X.Org X server -- Nouveau display driver ii xserver-xorg-video-qxl 0.1.5+git20200331-3 amd64 X.Org X server -- QXL display driver ii xserver-xorg-video-radeon 1:19.1.0-2ubuntu1 amd64 X.Org X server -- AMD/ATI Radeon display driver ii xserver-xorg-video-vesa 1:2.5.0-1build4 amd64 X.Org X server -- VESA display driver ii xserver-xorg-video-vmware 1:13.3.0-3build1 amd64 X.Org X server -- VMware display driver ii xtl-dev 0.7.2-2 all basic tools (containers, algorithms) used for xtensor and xeus ii xwayland 2:22.1.1-1ubuntu0.19 amd64 X server for running X clients under Wayland ii xxd 2:8.2.3995-1ubuntu2.24 amd64 tool to make (or reverse) a hex dump ii yaru-theme-gnome-shell 22.04.5 all Yaru GNOME Shell desktop theme from the Ubuntu Community ii yaru-theme-gtk 22.04.5 all Yaru GTK theme from the Ubuntu Community ii zenity 3.42.1-0ubuntu1 amd64 Display graphical dialog boxes from shell scripts ii zenity-common 3.42.1-0ubuntu1 all Display graphical dialog boxes from shell scripts (common files) ii zlib1g:amd64 1:1.2.11.dfsg-2ubuntu9.2 amd64 compression library - runtime ii zlib1g-dev:amd64 1:1.2.11.dfsg-2ubuntu9.2 amd64 compression library - development ii zstd 1.4.8+dfsg-3build1 amd64 fast lossless compression algorithm -- CLI tool bash: 未预期的记号 "newline" 附近有语法错误 ubuntu@Ubuntu01:~/桌面$
最新发布
07-13
make[1]: Entering directory '/home/ubuntu/EPICS/support/StreamDevice/configure' perl -CSD /home/ubuntu/EPICS/base-7.0.9/bin/linux-x86_64/makeMakefile.pl O.linux-x86_64 ../.. mkdir -p O.Common make -C O.linux-x86_64 -f ../Makefile TOP=../.. \ T_A=linux-x86_64 install make[2]: Entering directory '/home/ubuntu/EPICS/support/StreamDevice/configure/O.linux-x86_64' perl -CSD /home/ubuntu/EPICS/base-7.0.9/bin/linux-x86_64/convertRelease.pl checkRelease make[2]: Leaving directory '/home/ubuntu/EPICS/support/StreamDevice/configure/O.linux-x86_64' make[1]: Leaving directory '/home/ubuntu/EPICS/support/StreamDevice/configure' make -C ./src install make[1]: Entering directory '/home/ubuntu/EPICS/support/StreamDevice/src' perl -CSD /home/ubuntu/EPICS/base-7.0.9/bin/linux-x86_64/makeMakefile.pl O.linux-x86_64 ../.. mkdir -p O.Common make -C O.linux-x86_64 -f ../Makefile TOP=../.. \ T_A=linux-x86_64 install make[2]: Entering directory '/home/ubuntu/EPICS/support/StreamDevice/src/O.linux-x86_64' Creating ../O.Common/StreamVersion.h perl -CSD ../makeStreamVersion.pl ../O.Common/StreamVersion.h /usr/bin/g++ -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_X86_64_ -DUNIX -Dlinux -DUSE_TYPED_RSET -DSTREAM_INTERNAL -O3 -g -Wall -mtune=generic -m64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../include/compiler/gcc -I../../include/os/Linux -I../../include -I/home/ubuntu/EPICS/support/asyn/include -I/home/ubuntu/EPICS/base-7.0.9/include/compiler/gcc -I/home/ubuntu/EPICS/base-7.0.9/include/os/Linux -I/home/ubuntu/EPICS/base-7.0.9/include -MM -MF StreamEpics.d ../StreamEpics.cc /usr/bin/g++ -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_X86_64_ -DUNIX -Dlinux -DUSE_TYPED_RSET -DSTREAM_INTERNAL -O3 -g -Wall -mtune=generic -m64 -fPIC -I. -I../O.Common -I. -I. -I.. -I../../include/compiler/gcc -I../../include/os/Linux -I../../include -I/home/ubuntu/EPICS/support/asyn/include -I/home/ubuntu/EPICS/base-7.0.9/include/compiler/gcc -I/home/ubunt
03-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值