Git manages local projects

1. What is git?

        Git is a free, open source distributed version control system that can efficiently handle any project, small or large. Git is an open source version control software developed by Linus Torvalds to help manage Linux kernel development.

2. How to install git?

download link:

https://www.git-scm.com/downloads

0115bc1c2711389206abeb52f98c949b.png

    For detailed installation instructions, please refer to the following:

https://www.runoob.com/git/git-install-setup.html

3. Basic instructions of git

git init: Initialize the warehouse

git status: View the status of the current warehouse

git add: add files to the staging area (staging area)

git checkout: switch branches or restore working tree files

git commit: Submit the temporary storage area to the local warehouse

git pull: download remote code and merge

git push: upload remote code and merge

git clone: ​​copy a remote warehouse and clone the remote warehouse into a new directory

git reset: version rollback

The git command is as follows:

8d38f9e60add92209a1ea9a69793067d.png

30728b7fac31da7095087f541169e6e0.png

4. Examples of local project management

Step 1: Create a new initialization warehouse, git init

dee86c0c5ddf9f93a952508bb7c8b2f2.png

Step 2: Add files, git add

29dafc6f9aefa6966ebc0aa58c74ea4f.png

e7f85e3f60c13207fb707d9d27766577.png

Step 3: Submit the file, git commit -m

299a72ee368380cbd5526d4c10136955.png

Step 4: After modifying the file, re-add and submit

1765d866505f1844ff0bb5ea40d95327.png

21b3865e70af9f6e0684433056aab84d.png

Step 5: View log, git reflog

1d3951dcd21feaed2cb2dcaaad623948.png

Step 6: Roll back to the original version, git reset --hard

146c90a7c1405c85e0702adf06978074.png

Open the test file, the letters are changed back to numbers, and the results are as follows:

ef10b232f364cab392bdec0b459fefe9.png

Using git to achieve project management can facilitate project management.

Welcome to pay attention to personal public number:

9fdf16244763e02f2c68cb8c089eb586.png

Guess you like

Origin blog.csdn.net/weixin_46158019/article/details/130570598