Git is one of the most popular tools used for distributed version control system(VCS). Git is commonly used for source code management (SCM) and has become more used than old VCS systems like SVN.

Installing Git on Ubuntu 16.04 LTS

Pre-Flight Check
  • You should be running a server with any Ubuntu 16.04 LTS release.
  • You will need to log in to SSH via the root user.
  • In this tutorial I’ll be working with a Core Managed Ubuntu 16.04.4 LTS server

First, as always, we should start out by running general OS and package updates. On Ubuntu we’ll do this by running:apt-get update

After you have run the general updates on the server you can get started with installing Git.

  1. Install Git 【需要root权限】
    apt-get install git-coreYou may be asked to confirm the download and installation; simply enter y to confirm. It’s that simple, git should be installed and ready to use!
  2. Confirm Git the installation
    With the main installation done, first check to ensure the executable file is setup and accessible. The best way to do this is simply to run git with the version command.
    git --version【非root角色登陆查看】
    git version 2.7.4
  3. Configure Git’s settings (for the root user)
    It’s a good idea to setup your user for git now, to prevent any commit errors later. We’ll setup the user testuser with the e-mail address testuser@example.com.
    git config --global user.name "testuser"
    git config --global user.email "testuser@example.com"
    Note:
    It’s important to know that git configs work on a user by user basis. For example if you have a ‘david’ Linux user and they will be working with git then David should run the same commands from his user account. By doing this the commits made by the ‘david’ Linux user will be done under his details in git.
  4. Verify the Config changes
    Now we’ll verify the configuration changes by viewing the .gitconfig file. You can do this a few ways, we’ll show you both methods here.
    1. View the config file using cat with the following command:
      cat ~/.gitconfig
    2. Or, you can also view the same details using the git config command:
      git config --list

And that’s it! You have now installed Git on your Ubuntu 16.04 LTS server and have it configured on your root user. You can get rolling with your code changes from here, or you can repeat steps 3 and 4 for the other system user accounts.

Be Sociable, Share!

安装git工具在ubuntu系统的更多相关文章

  1. SLAM+语音机器人DIY系列:(一)Linux基础——2.安装Linux发行版ubuntu系统

    摘要 由于机器人SLAM.自动导航.语音交互这一系列算法都在机器人操作系统ROS中有很好的支持,所以后续的章节中都会使用ROS来组织构建代码:而ROS又是安装在Linux发行版ubuntu系统之上的, ...

  2. Windows 下安装Git工具及基础使用

    Git简介 git是很好一个工具使用,可以执行liunx命令,有git环境后windows系统就可以进行shell命令操作,就可以添加其他liunx辅助软件进行执行,git也代码库管理工具,无论是上传 ...

  3. Ubuntu下安装git工具

    环境:Ubuntu 9.10 git-1.8.2.3.tar.bz2 1.将安装包下载到所选文件夹下,如:/tmp 2.tar -xjf git-1.8.2.3.tar.bz2 3.cd git-1. ...

  4. 高显卡安装 低版本的ubuntu系统导致hdmi线不能用

  5. 源码安装git工具,显示/usr/local/lib64/libcrypto.a(dso_dlfcn.o) undefined reference to `dlopen'

    /usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':dso_dlfcn.c:(.text+0x30) ...

  6. CentOS_6.5 64位系统,安装git服务器+客户端

    ================ git服务器安装 ==================== CentOS安装Git服务器 Centos 6.4 + Git 1.8.2.2 + gitosis## . ...

  7. git工具的安装和使用

    啰嗦几句: 世界上本没有后悔药,但软件开发提供了后悔药,那就是代码管理工具.它可以让你的代码穿越回以前的状态,甚至可以指定某一个时刻,而且还可以穿越回来. 当下流行的代码管理工具有 SVN 和 GIT ...

  8. Ubuntu 系统服务器初始化配置、安全加固、内核优化和常用软件安装的Shell脚本分享

    转载自:https://www.bilibili.com/read/cv13875402?spm_id_from=333.999.0.0 描述: 适用于企业内部 Ubuntu 操作服务器初始化.系统安 ...

  9. Git工具的使用教程

    Git 是一种版本控制工具,也叫作版本管理软件(分布式管理软件).这里介绍Git的基本使用步骤,关于 Git 更详细的介绍,读者可以参考其官方网站提供的文档. 1  安装Git 在Ubuntu系统中安 ...

随机推荐

  1. python pip 下载慢 配置使用国内源配置

    ubuntu apt 使用国内源 设置>软件和更新>下载自 选择mirrors.aliyun.com/ubuntu 更新源sudo apt-get update 安装系统包:sudo ap ...

  2. opencv对手写数字进行无黏连切割

    //src:待分割的二值图,最大值为255 //segMat:分割好的每个图片 //算法:判断连通域,有几个连通域就会分割成几个子图片 //用途:手写数字识别中进行无黏连数字的分割 void getC ...

  3. node中可读流、可写流

    javascript的一个不足之处是不能处理二进制数据,于是node中引入了Buffer类型.这个类型以一个字节(即8位)为单位,给数据分配存储空间.它的使用类似于Array,但是与Array又有不同 ...

  4. 微信小程序如何提交审核并发布?发布问题:小程序只支持https访问

    http://www.jisuapp.cn/news/305.html 发布问题:1.小程序只支持https访问 2.要配置服务域名

  5. webpack 学习

    ·1.https://www.2cto.com/kf/201711/696035.html 2. http://blog.csdn.net/x550392236/article/details/784 ...

  6. table-cell http://www.cnblogs.com/StormSpirit/archive/2012/10/24/2736453.html

    http://www.cnblogs.com/StormSpirit/archive/2012/10/24/2736453.html

  7. Python 测试

    (1)import doctest doctest.testmod(verbose=True) (2) pip install tests

  8. pring Boot 与Spring Cloud版本对应

    Spring Boot Spring Cloud 1.2.x Angel版本 1.3.x Brixton版本 1.4.x Camden版本 1.5.x Dalston版本.Edgware版本 2.0. ...

  9. Steering Behaviors

    [Steering Behaviors] 1.Seek 下述的算法是一个基本Seek行为,但不带任何Steering输出的力.在该公式作用下,游戏个体的移动方式是直线型的,如果target的位置变了的 ...

  10. pecan API调用

    1.在PasteDeploy部署caesar-api服务时,setup_app中建立app,app中设置hooks,hooks负责加载conf配置文件和数据库连接 self.storage_conne ...