Installation and configuration substantially git

gitBasically, it is an indispensable tool for a developer, not the server where gitit is not able to justify. Moreover, there is no git, then oriented programming github where to start, as a programmer broken right-hand man.

You will be able to operate after the completion of the process are familiar, only takes a minute

installation

$ yum install git

If you use yumto install git, then it is not necessary to open an article in a single. That use yumwhere the shortcomings in? We know that, yumin order to ensure the stability of its warehouses, often the software version will be very old.

And with the yuminstallation of gitno syntax highlighting!

Use ansible installation

If you do not know enough about ansible, you can refer to my article ansible Getting Started

Choose a nice Ansible Roleon it, we choose geerlingguy.git . Specified variable, from the source installation, and install the latest version.

hosts: dev
  roles:
  - role: geerlingguy.git
    vars:
      # 从源码安装
      git_install_from_source: true
      # 安装最新版本
      git_install_from_source_force_update: true

Use ansible-playbookthe server installation batch

$ ansible-playbook -i hosts git.yaml

Successful installation

git versionCheck the version number, in this case, 2.16.2

$ git version
git version 2.16.2

It then git statusview the next syntax highlighting effect

git highlight effect

Configuration

Global mail and user name, then you can happily use the server gitmanagement code

$ git config --global user.name shfshanyue
$ git config --global user.email [email protected]

Oriented Programming github

But for now you can githubprogram it? Do not!

Use ssh -Tconnectivity test

$ ssh -T [email protected]
Permission denied (publickey).

At this point needs to be configured ssh keyto ensure proper github-oriented programming, you can view the next article ssh key configuration and github

Guess you like

Origin www.cnblogs.com/xianwang/p/12099864.html