Basic tips for using Git



1. What is Git

An artifact of version control and collaborative development! ! ! I believe everyone is familiar with it, but if you do development knowledge and directly perform pull and push operations in the compiler, and you don’t remember the basic dos instructions of git, just read this article!

Two, Git development process

directly on the map
gitl flow chart


Three, Git basic instructions

1. 5 basic operation instructions

git init  # 初始化仓库
git -log  # 查看日志(important!)
git add <文件名.>  # 添加到缓存区
git commit -m "注释"  # 提交到仓库
git merge <分支名>  # 合并指定分支到当前活跃的分支

2. Branch switching class

git checkout <分支名>  # 切换到某个分支
git checkout -b <分支名>  # 创建并且切换

3. Remote operation

git clone <远程地址> [本地文件夹] # 克隆到本地
git pull  # 拉取远端仓库到本地

不到最后千万别push,千万小型push,虽然可以找回,但会被骂...

git push  # 推动本地到远端分支

Summarize

  • These Git operations were also taught by Mr. Dark Horse last year, but they have been sorted out a little, and they are easy to find.
  • The commonly used operations of Git are all here, and the instructions and visual interface operations of other compilers are not listed here.

Guess you like

Origin blog.csdn.net/wnagchenyu/article/details/129758895