Version Control System (VCS) is a generic name for program code management software. It is used to save the modification records and historical versions of program files for later viewing or use. Vcs has a history of decades. The earliest systems used centralized management and control. If you want to modify a program file, you must first lock it and then remove the modification. No one else can make changes to the program file until the modification and postback are complete.

This avoids “confict” (that is, preventing multiple people from modifying the same piece of code at the same time), but at the cost of reduced efficiency. If the file you want to modify happens to be being modified by someone else, you must wait for the program file to be sent back. If you have to modify a lot, the time wasted waiting for each other can be significant. To address this problem, the new VCs has changed to a distributed approach. Git is a distributed system in which each user can retrieve any program file at any time to modify, and then “merge” it as needed when it is sent back to VCS.

Therefore, on the basis of fully learning Git GitHub Git Server technology stack, combining my own practical experience and the open source practice of front-line Internet companies at home and abroad, I put forward a lightweight micro-service reference technology stack that is closer to the characteristics of domestic technology and culture, and organized a set of Git practical documents with a thorough explanation. I want to share with you today.

What do you get out of this document?

  1. Familiarize the reader with the basics of Git
  2. Then learn the practical application of Git in team development mode, and introduce GitHub, Bitbucket. GitL ab and other websites that provide Git services
  3. Readers can communicate with project developers around the world, improve the experience and ability of program development.
  4. Finally, several methods of setting up Git Server are introduced, so that each project development team can choose a suitable way to effectively control their own projects according to their own software and hardware environment.

Document Contents

The first part introduces the basic concepts and operations of Git

  • Lesson 1 Git, who to contend with
  • Lesson 2: Git configuration files
  • Lesson 3: Save files to a Git document library
  • Lesson 4 comparing file differences and retrieving files from a Git document library
  • Lesson 5 Practice of Git program item management
  • Lesson 6 Obtaining Git document library statistics and drawing statistics charts

The second part branches, merges, and resolves conflicts

  • Lesson 7 Branch of a program project
  • Lesson 8 Merging program project branches and resolving conflicts
  • Lesson 9 Update the starting point of a branch with the Rebase directive
  • Lesson 10 A practical walkthrough of branching and merging program projects

The third part is the graphical operation interface of Git program

  • Lesson 11 Basic functions of Git GUi programs
  • In lesson 12, create branches and merges using the Git GUI program
  • Lesson 13 Introduction to the SmartGit program
  • Lesson 14 SourceTree program operation introduction
  • TortoiseGit

Part four: Remote Git document libraries and team switch patterns

  • Lesson 16: Remote Git Document library
  • Lesson 17: Remote Git Repositories
  • Lesson 18 GitHub takes application projects to the cloud
  • Lesson 19 Fork and merge Git document libraries
  • Lesson 20 Bitbucket is better than GitHub
  • Lesson 21 GitLab is totally free plus the whole system

The fifth part sets up Git Server

  • Lesson 22 Using a Windows Shared folder or Git Daemon as a Git Server
  • Lesson 23 Using HTTP/HTTPS to access Git Server
  • Lesson 24 using SSH to authenticate and encrypt Git Server

Git basic concepts and operations

1. Git can manage files and folders in any folder. If you run “Git init” in this folder, Git can complete the preparations before management. Git creates a so-called repository in this folder (we call it a “document repository”) that holds the contents of the managed files and folders, including all historical versions that have ever been added.

2. The “document repository” is actually a folder named “.git”, which is hidden by default. You can change the view options of the folder so that the hidden files and folders can also be displayed normally. .

Git can handle files and folders with Chinese names correctly, but Git Bash program will display Chinese characters with garbled characters. Later we will introduce gitk graphics view mode, which can display Chinese characters correctly.

Git init- help: git init- help: git init- help: git init- help: git init- help: git help

5. If the command is too long and you want to move to the next line, you can end it with the backslash character “\” and press Enter to continue typing.

Git(there are three different levels of configuration files with different priorities, and the Settings in the higher priority file will overwrite the same Settings in the lower priority file. The following are presented in descending order of priority:

Establish branch merging and conflict resolution

In most cases, the branches of a program project are merged into the main branch. Unless you decide to separate the branch into another program project. Branches of a merge project need to use the “git merge” directive.

After learning how to use Git instructions and operations, in this unit you will learn how to import Git management mechanisms as you develop your projects. The strategy for using Git will be introduced first, followed by an actual program project.

A graphical interface for Git programs

So far, we’ve been using Git Bash programs to learn how to use Git. Git Bash programs operate Git document libraries as input instructions. Compared with the GUI program, this command line mode program seems to be more troublesome. In fact, Git Bash programs are the tools that can give full play to Git’s capabilities. Beginners should start with the GitBash program to build a solid foundation of Git instructions and a complete understanding of how the Git document library works.

TortoiscGit is also a graphical user interface Git program, and its popularity is one of the most popular programs in the same type. It is an open source program project and is therefore completely free to use. TortoiseGit’s official website can be found if you do a Search on Baidu or Google. It is available in 32-bit and 64-bit versions, and you must download the appropriate installation file for the version of Windows your computer is installed on. Once downloaded, execute the installation file and follow the on-screen instructions to complete the installation.

Remote Git document library and team switch mode

So far, the Git document libraries we’ve been working with have been stored in the project’s folder (that is, the “.git” subfolder). As the project progresses, we will add the contents of the files from different phases to the Git document library. This Git document repository is directly controlled by us and is called “Local Git Document Repository”. In addition to a “local Git document repository,” you’ll also need a “remote Repository” if you need to work with others on your project. In this unit we will introduce the functions and usage of the remote Git document library.

Bitbucket is already much more generous than GitHub, allowing us to create private Git document libraries for free. But The GitLab site goes a step further, offering items that other sites charge for completely free. Not only that, it also makes the entire system’s program code public, so that people can install on their own computers, to create a completely private GitLab website. In this unit we will cover the use of the GitLab website and how to create a GitLab website on your own computer.

Set up Git Server

This unit starts with two of the easiest ways to access a remote Git document library. Neither method requires any additional software installation. The first is to use the Windows operating system’s own network “shared folder” function. The second is to use Git’s built-in daemon functions.

Most companies don’t want to store their hard-earned programs and projects outside the company. Especially for high-tech companies, software is one of the most important assets and should be closely protected. Therefore, in order to store these important intellectual property, you need to create a private Git Server within the company and strictly control access to it to prevent theft. In this unit we will introduce how to set up a Git Server that can be accessed through HTTP and HTTPS, and add account and password protection.

Due to space constraints, xiaobian here will only the actual combat document contains all the contents of the show, need to obtain a complete document to learn friends can pay attention to the work number



If useful to you, I hope to get your forwarding, thank you for your strong support! You can also share the project source code on GitHub

Project source code sharing based on multi-merchant permission system + mall platform +CMS+ micro service API system

  • Project core: multi-merchant permission system + mall platform +CMS content management + micro service API system
  • Architecture technology: Eureka, Hystrix, Feign, Config, Gateway microservices architecture, integrated with distributed transaction solution SEATA, Integrate redis, Quartz, Tk.Mybatis, Lombok, various design patterns, etc.
  • Project advantages: clearer architecture, more cutting-edge technology, cleaner code, more beautiful page, commercial learning. It can be used for the secondary development of OA system, CRM system, PDM system and other micro-service architecture learning. It is very suitable for upgrading the old version of the company’s management platform and rapid integration of new platform construction. Meanwhile, IT provides API interface services (for APP, micro-terminal, H5, etc.).
  • Projects show

    Support billions of levels, no code invasion of a Java distributed log system source code sharing

    A Java distributed logging system, the level of support billions, log from collecting to query, don’t need to log file through convenient and quick, support query log a call chain, support link tracking, checking their invocation chain takes in a distributed system can also be associated query log, can help fast positioning problem, easy to use, no code invasion, Query interface friendly, efficient, convenient, as long as you are a Java system, do not do any project transformation, access directly use, logs do not fall on the local disk, there is no need to care about the log occupy the application server disk problem.