Git pull project process and command explanation

git pull project process and command explanation

  • 1. Introduction to git
  • 2. Basic concepts of Git:
  • 3. Git installation
  • 3. Git initialization operation command
  • 4. Git basic process (from 0-1 steps):
  • 4. Basic tools
  • 5. Common commands
  • 6. Next questions:
    • The background of the emergence of Redis:
    • Redis basic types:
    • Some problems and solutions that will be encountered after the project is released

1. Introduction to git

Git is a distributed version control system that can record the change history and versions of code, and coordinate modifications to the same code base by multiple developers to ensure the continuity of code changes and the smoothness of collaborative development.

2. Git basic concepts:

  1. Repository: A place where code is stored, which can be local or remote.

  2. Commit: Save the code snapshot in the warehouse, recording the code change history.

  3. Branch: An independent branch of the code, used to carry out multiple development tasks at the same time without affecting the main branch code.

  4. Merge: Merge the code of two branches into one.

  5. Pull: Get the latest code from the remote repository.

  6. Push: Push the submissions in the local warehouse to the remote warehouse.

3. Git installation

Download portal
Git domestic download address

Find the version commonly used by the company, download the corresponding version, and just click on it.

After installation, right-click on the desktop and open Git Bash Here
Enter the console interface and enter git –version
Check the installed version.

3. Git initialization operation command

Configure username
git config –global user.name “Fill in your name”
Configure mailbox
git config –global user.email [email protected]

4. Git basic process (steps 0-1):

After installation:

  1. View version: git –version

  2. Configure user name: git config –global user,name “***”

  3. Configure email: git config –global user.email ***

  4. Initialize a new Git repository: git init

  5. Log in to gitee and copy the warehouse address

  6. Establish a connection with the remote repository: git remote add orlgin https://gitee.com/****.git

  7. Pull the remote branch to the local git fetch origin dev (master) (dev/master is the branch name of the remote warehouse)

  8. Create a branch locally and switch to it git checkout -b dev origin/develop

4. Basic tools

Git provides a variety of command line tools and graphical interfaces, such as Git Bash, GitHub Desktop, etc., which can be selected and used according to different needs.

5. Common commands

1, git init

Initialize a new Git repository.

This will create a subdirectory called “.git” in the current directory, where Git will store the metadata for all repositories.

Function: Used to initialize a new Git repository. After executing this command, Git will create a subdirectory named “.git” in the current directory, which stores all metadata of the warehouse.

2, git clone

Clone an existing repository.
This creates a copy of the local repository, including all of its history and branches.

git clone <warehouse link>

3, git add

Add the modifications to the next commit.
This will add the specified files to the staging area, which will be included in the next commit.

git add file1.txt file2.txt

4, git commit

Create a new commit.
This will record changes to the staging area and any other changes made since the last commit, along with a commit message describing those changes.

git commit -m "Add new features"

5, git push

Push commits to the remote repository.
This will send the local commits to the specified remote repository, updating the remote branch to include the new commits.

git push origin main

6, git pull

Get and merge changes from remote repository.
This fetches the latest commits from the specified remote repository and merges them into the current branch.

git pull origin main

7, git remote

Associate the remote warehouse and establish a connection with the remote warehouse.

git remote add orlgin https://gitee.com/****.git

8, git branch

List, create or delete branches.
This command can be used to list the branches available in the repository, create new branches or delete existing branches.

git branch new-branch

Branch deletion

git branch -d <branch name>

9, git checkout

Switch to a different branch.
This command allows you to switch to a different branch in the repository and make it the current working branch.

git checkout main

10, git merge

Merge one branch into another branch.
This command merges changes from one branch into another branch, creating a new commit that reflects the merged changes.

git merge new-branch

11, git status

Shows the status of the warehouse.
This command displays the current branch, any staged or unstaged changes, and any untracked files.

git status

12, git rebase

Merge changes from one branch to another branch.
Suppose you made some changes on the “XYZ” branch and you want to merge these changes into the “main” branch. You can use the git rebase command to re-apply your changes to the main branch.

13, git revert
Application scenario: Sometimes we find after submitting that we have missed a few files and have not added them, or the submission information is wrong and we need to revoke it.
You can use git revert to create a new commit that undoes the changes introduced by the previous commit.

git revert <commit1>..<commit2>

14. git .gitignore
How to use:

  • Tell Git to ignore all files ending in .o or .a:*.[oa]
  • Tell Git to ignore all files whose names end with a tilde (~) File: * ~

1Ignore all .a files

*.a

2? But track all lib.a, even if you ignored the .a file earlier

!lib.a

3Ignore .pdf files in the doc/ directory and all its subdirectories

doc/**/*.pdf

6. Next question:

Background of the emergence of Redis:

Nosql explanation
Alibaba architecture evolution
Nosql data types
Nosql four major categories
CAP theory
BASE theory
Redis uses:
Getting started with Redis
Redis installation

Redis basic types:

Five basic types
Three special types
Detailed explanation of Redis configuration
Redis core:
Redis persistence
①RDB
②AOF
Redis transaction operations
Redis implements subscription publishing
Redis master-slave replication (how to operate)
Redis sentry mode (all projects in the company are now in sentinel mode)

After the project is released, some problems and solutions will be encountered

Cache penetration and its solutions
Cache breakdown and its solutions
Cache avalanche and its solutions
Detailed explanation of basic API and Jedis
SpringBoot integrated redis operation