The birth of Git is an interesting story. Linus opened the Linux kernel to open source in 1991, and countless Linux enthusiasts were writing code for Linux all over the world, so the question was, how do you manage that code? Linus initially used BitKeeper to manage the core development of Linux, but when BitMover stopped supporting Linux, Linus stuck to its own version-writing ethos. I spent two weeks writing my own distributed version control system in C called Git.

Introduction to Git

Look at Git from a principle perspective

The traditional design scheme can be simply divided into two parts: working directory and remote warehouse. But as a targeted distributed version control system, the first step is to add a local repository. We then choose to add a buffer area called staging between the working directory and the remote repository.

If you still don’t get it, take a look at this condensed version.

You strangle me if you still can’t use GIT

Whether you are front-end or back-end, whether you are in operations or mobile development, GIT is unavoidable. Of course, if you say you want to use SVN, that is not the scope of this discussion. Learn how to use GIT in 10 minutes. This tutorial will be different from what you can find on other websites.

Practice is the quickest way to master a tool.

Git practical details

What is a version library? Git keeps track of all changes and deletions of files in a repository, so that they can be traced at any time in history or “restored” at any time in the future.

Combat is over, to try to learn how much.

In order to ensure that everyone can go through the customs smoothly and learn all the knowledge points, I will write the clearance strategy and introduce the gameplay of each level in detail. And I will not directly give the answer, but to demonstrate the whole process.

Get through the 54 levels and light up your Git skill tree

Clear the 54 levels and light up your Git tree.

Get through the 54 levels and light up your Git tree

Get through the 54 levels and light up your Git tree.

Get through the 54 levels and light up your Git tree.

Get through the 54 levels and light up your Git tree

Enclosed is the cheat sheet.

Git git

  • Connecting the remote repository configuration for the first time

  • Management of change

  • Undo changes (not committed [commit])

  • Delete the file

  • Create and merge branches

  • Bug branch management

  • Remote warehouse operations

Git git

Here are some common commands to learn how to use Git, and some solutions to the problems encountered in the process of using git.

Git in depth

I believe that after the above introduction, and then compare the diagram below will be more harvest and experience.

Git Illustration 1: Code area summary

In the background of this paper, I have used Git for more than a year in the actual project, and found that many colleagues could use common Git instructions, but did not understand the corresponding function principle of each instruction. Today, take a moment to summarize the basic understanding of Git: the existence of code area; Based on the actual project, this article clarifies the code migration process in the process of using Git.

Git Illustration 2: Code Rollback

Scenario: COMMIT a COMMIT (which contains many files), find a problem, and need to roll back, rolling back the online branch (master) to the last COMMIT.

Git Illustration 3: Branch operations

Git branches are its most obvious feature. Most people will hear “Git branches are easy to operate…” Git branches are incredibly lightweight compared to other version control systems. Creating new branches is almost instantaneous and switching between branches is very fast and convenient. This article will combine practice and drawing to summarize common branch operation instructions and precautions of Git.

Finally finished, finally to summarize the review.

Understand Git

Personally, I think Git needs to be learned carefully. Although it is a tool, it is easy to get confused without learning it. I hope this blog can help you at some point, so that you can roughly understand how Git works and put the basic commands together. Git’s basic commands are listed below.

Git in its simplest form

This article focuses on the structure of the diagrams that underpin Git and the ways in which the nature of those diagrams affects Git behavior. By understanding the basics, you can base your model of Git in your mind on facts rather than assumptions based on experience. This more realistic model will give you a better understanding of what Git does, is doing, and will do.

Git advanced

Git Branch Management

Master is the default Master branch of Git. After the repository is initialized, development is performed in the Master branch by default. The master branch code is the most complete and cleanest for production.

The main branch should only be used for major releases, and daily development should be done on the other branch. We call the development branch Develop.

There are also ancillary development branches for release development for specific purposes.

Git reset and checkout

Git checkout > Reset > Checkout > Git checkout > HEAD > Index > Working Directory

3. Complex vs. Rebasing Git series

Git Rebase has a reputation for being the “Dark Magic of Git that novices should stay away from”, but when used properly, it can make team development a breeze. This article will compare and contrast two similar commands: git rebase and git rebase to distinguish their usage scenarios and finally incorporate “dark magic” into your workflow.

Git Rebase principle and golden rule

In this article, we will explain the basic concepts and usage of Git Rebase, its internals, and the principles you should follow when using Git Rebase in a real project, and why you should follow them.

How Git generates diff: Myers algorithm

Diff is a feature we use every day. Every commit, I use Git diff –cached to see what has changed, make sure it’s okay, and then commit. Git generated diff is very intuitive, so intuitive that I have never thought about how to generate diff, think it should be a very simple thing, two files to do a comparison, not on the line.

Git from shallow to deep storage principle

This article originally planned to introduce the related knowledge points and operations of Git branch, but in the process of preparation, I found that it involves a lot of internal storage principles, so I decided to introduce Git storage principles first. Understanding these will be helpful to understand the following content, and will be of great help to use Git.

Talk about Git code rollback

This article describes how to use git rebase -i and git cherry-pick to implement code rollback. Code rollback is a high-risk operation. Use it with caution.

Git higher-order

Learn Git workflow (Git-workflow-tutorial)

Workflow is not a primary topic. The underlying issue is effective project flow management and efficient development collaboration, not just the use of VCS or SCM tools such as Git or SVN.

This guide starts with the centralized workflows that you are familiar with in SVN and progresses to other efficient distributed workflows step by step. It also describes how to use the convenient Pull Request function to systematically explain the application of various workflows.

Git Work Flow

A uniform workflow is essential, regardless of the industry. For us developers, the workflow includes Git usage specifications at development time, Repo management specifications, testing process specifications, design interaction management specifications, and so on. This article focuses on Git usage specifications and repO management specifications.

Git Workflow Guide: Gitflow Workflow

The Gitflow workflow defines a strict branching model around project release. Although somewhat more complex than a functional branching workflow, it provides a robust framework for managing large projects.

Instead of using concepts and commands that go beyond functional branch workflows, the Gitflow workflow assigns a well-defined role to the different branches and defines how and when the branches interact with each other. In addition to using functional branches, the respective branches are also used for preparation, maintenance, and documenting releases. Of course you can take advantage of all the benefits of a functional branching workflow: Pull Requests, isolation of experimental development, and more efficient collaboration.

GIT development process beginner’s Guide for r&d team

In this paper, aimed at to use GIT branch of standard development process of the development team can provide a new reference guide, the contents are our company in research and development team start-up to follow some of the standard development process, after nearly a year of practice, although there are many shortage, but with the expansion of team of experienced and personnel, I will timely update the article, Share the problems and solutions we encountered in our development process with GIT.

Git dry product series :(6) the company builds git server internally

Because gitHub projects are public, it is not suitable for internal projects, and private projects need to charge, which is not what we want. So I found a free gitLab similar to gitHub. Now I will record the process of setting up gitLab for reference.

Use Git Subtree to bidirectionally synchronize subprojects between Git projects

When do YOU need a Subtree?

  • 1. When multiple projects share a lump of code that is rapidly updated with the project

  • 2. Migrate some code to a new Git repository, but want to keep the commit history of this code.

Git-WebHook Automatic deployment tool – supports Github/GitLab/Gogs/GitOsc

Git WebHook is a Python Flask + SQLAchemy + Celery + Redis + React system for quick setup and automatic deployment. Github/GitLab/Gogs/GitOsc

Python uses the Tornado framework for WebHook automatic deployment of Git projects

In order to facilitate the development of testing or project deployment to the server is not so tedious, a small wheel of automatic deployment is also necessary. Small Wheel needs to involve Coding project hosting platform (Github platform can also be used), Linux server Nginx, Python(Tornado framework). At the same time, configure the personal private key or project public key of the project hosting platform to ensure that Git pull can be directly pulled.

How to set up a Git central repository on Linux

Introduction: This tutorial is for individual developers who want to build their own Git central repository on Linux for uploading and publishing their own projects. However, there may be more requirements for teams to build a visual version management system similar to Github using GitLab

Git little knowledge

Git common commands display pictures

Take a look at the unknown but common Git operations

Git tips

Love the little things you do with Git

Git code statistics

Resolve Git merge branch conflicts

[Git] Git config Common configuration

Use “5W1H” to write a highly readable Git Commit Message

Git region-free Git secret-free

How do I get Git to ignore single/multiple lines in a file

Git multi-account login problem

How does Git delete remote server files and keep local files

How do I log out of a Git account in phpStrom

Vscode integrates Git bash

How to submit an empty directory in Git

How does Git check out a specified directory or file

Migrate the Svn to Git

# SegmentFault Technology Weekly #

Tech Week is a weekly series of community-specific technical content. Weekly selects each content, is the author’s original opinion, trample pits summary and experience sharing.

Updated every Thursday, please “follow” or “subscribe.” You can also leave comments on topics you are interested in and recommend excellent articles related to the topic.