Author: Yoichi

The original:Mp.weixin.qq.com/s/7XTrdVqtU…

Zero — let me write it out front

Hello, I am Yang Yi, an Internet person who continues to grow up.

Find out in lecture 1: What is Git? Before using Git, we need to install and build a Git environment. Let’s try it together!

When marching and fighting, the troops and horses are not moving, the food and grass come first. If you want to have a hot meal, put the pot up first!

Install Git

Open the browser, log in to git-scm.com/, and download the corresponding version according to the system of your computer. This time, MacOS system is the main system.

1. Access the official website

2. Click on the Downloads

Here, we can actually see that the corresponding version of our computer system has been identified in the lower right of the above picture, and you can click to download it yourself. If you want to learn more, you can click Downloads to see the details:

3. Installation mode

1. Install the Mac system

As you can see, there are many official ways to install the Mac system: Homebrew, Xode, etc. I recommend you to use Homebrew to install the Mac system. Of course, if you haven’t installed Homebrew before, you’ll need to!

Homebrew is a management software tool under macOS platform, with installation, uninstall, update, view, search and many other practical functions.

# Install Homebrew, open console, Enter setup command/usr/bin/ruby - e "$(curl - fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Copy the code

Can understand by oneself, here do not do too much explanation! This assumes that you have Homebrew installed.

Install git with homebrew, open the console, and type brew install gitCopy the code

After the installation is complete, run the version command to verify whether the installation is successful. If the version is displayed, the installation is successful!

Taidemacbook-pro :~ tai$git --version git version 2.19.2Copy the code

2. Install Windows

Here, I give you find a more detailed article on the Internet, reprinted to blog park installation address, we can according to the tutorial step by step fool installation can!

2. Configuration Description

1. Basic configuration

After installing Git, we need to do some Git configuration, such as global configuration, project specific configuration, etc

Git usernames and mailboxes are the first thing you need to do after installing Git

Git config --global user.email git config --global user.emailCopy the code
  • Git config –global git config –global git config –global git config –global
  • Git config –system: applies to all users on the current machine

2. Understand commands

  • Git config –list
taideMacBook-Pro:~ tai$ git config --list
credential.helper=osxkeychain
user.name=xxxx
[email protected]
core.autocrlf=input
Copy the code
  • Git config user.name: git config user.name
taideMacBook-Pro:~ tai$ git config user.name
xxx
Copy the code
  • Git options available
XxxdeMacBook -pro :~ XXX $git add -h -n, --dry-run exercise -v, --verbose output -I, --interactive picking -p, --patch Interactive picking data block -e, --edit Edit the current difference and apply -f, --force allows you to add ignored files -u, --update traced files --renormalize renormalize traced files -n, --intent-to-add records only, -a, --all adds all changed traced and untraced files --ignore-removal ignores the path removed from the workspace (same as --no-all) --refresh does not add, Only refresh index - ignore - errors skipped due to error can not add files - ignore - missing inspection in exercise mode files (even if they don't exist) are ignored, chmod (+ | -) x executable files in the listCopy the code

Official documents

For the introduction of Git, the official must be relatively authoritative and detailed, strongly recommend! Some friends may ask, “Is it meaningful for you to write this series of tutorials?” Of course, I will do this series from the direction of enterprise practice, not only introduce theoretical knowledge and simple operation commands, but also introduce the methods, skills and trial-and-error experience that are often used in practical work. Am I being blunt?! Get in the car! Don’t hesitate! Early, is the advantage!

Document address: Click on portal: git-scm.com/book/zh/v2/…

The Book page of the official website is opened in English by default, and can be switched to Chinese for easy reading. Big guys can be ignored!

Well, that’s all for today! Welcome to the comments section to participate in the exchange and discussion, the original is not easy, welcome to share!

Recommended reading

1. Find out: What is Git?