• 安装git工具在ubuntu系统


    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!
  • 相关阅读:
    全程图解】ADSL+笔记本电脑 组建WIFI网络让5800实现WIFI上网(更新完毕)
    JSP用户管理系统【上学应付作业用】
    c++按位操作符
    F#: .NET中的函数编程语言
    Visual Studio OpenGL 配置方法
    Linux下挂载U盘方法
    开发者该以什么为骄傲
    POSIX约定与GNU长选项
    修复移动硬盘"文件或目录损坏且无法读取"
    某国外论坛关于什么是Computer Science的争论,你怎么看?
  • 原文地址:https://www.cnblogs.com/x-poior/p/9288031.html
Copyright © 2020-2023  润新知