Experiment a & # 160; & # 160; GIT code version management

Experiment a GIT code version management

Purpose:

1) understand the core mechanism of the distributed distributed version control system;

2) git master basic instructions and a branch management instruction;

Experiment:

1) install git

2) the initial configuration git, git init git status command

3) master git log, git add, git diff command

4) master git tag git branch, git commit command

5) master git revert command

Experimental records:

1) The results of experimental content Screenshot

Initial Configuration git git init git status

在开始使用 Git 之前,你需要配置 Git。在命令行工具中运行以下每行,确保所有选项都已被配置好。

The terminal will display the git init command is running. This command will generate initialize an empty Git repository in the current directory.
git status command displays a lot of information, depending on your file status, working directory and warehouses.

git log

git log command information repository for all commit to display.
: By default, the command warehouse will show each commit
SHA
Author
date
news

git add and commit

git add command to move files to the staging area from the working directory
git commit command will remove the file and save it to a temporary storage area of the warehouse.

git diff

git diff command to view the execution but has yet to commit changes

git tag

git tag command to mark a particular commit. When adding a new commit, the label does not move.

git branch

git git branch command is used to manage the branch
This command is used:
lists the local branch
to create a new branch
deleted branches

2) the problem occurred during the experiment and solve

1.安装git阶段,下载速度过慢,故使用git bash代替
2.git clone 时应该确保所在目录没有仓库了,因为仓库不能嵌套

实验总结与体会

学习了git更加方便的去控制流程的进行,也使得多人操作成为可能,便于查看工作进度,同时使用分支与合并也方便了对代码的测试以及版本的更新

思考题:

阅读维基百科和百度百科 的Git词条,总结分布式分布式版本控制系统的核心机理

就是一个多任务系统, 将一个业务拆分, 部署在不同机器上。 Git实现了版本库的本地存储,每台机器都是等价的,都有工作区和版本库,开发人员无需联网就可直接在本地进行工作,工作成果可直接保存到本地版本库,任何两台机器都可通过相互交换各自的版本库来更新信息。

Guess you like

Origin www.cnblogs.com/cctv-cc/p/12356267.html