Version Control System

Version control system (Vcs) is a tool or software that helps to manage different versions of source code.
Source control is another name for version control systems.

In other words, version control is a system that carries records of all file changes or file sets with respect to time so that we can easily switch to previous versions in the future.

What is Git

image.png

Git is a version control system (VCS) that helps track file changes in a simple way. Git is a free and open source distributed version control system with a simple UI design that everyone can easily understand. With the help of Git, we can track small to large projects quickly and efficiently.

image.png

  • Repository: A collection of source codes or files for project work. The repository can exist in the local environment or in the form of a remote copy on another computer. The repository consists of commits.
    Working Directory: is the source code or file you see in the computer file system. When you open the project file on the code editor, you are using the file in the working directory.
  • Staging Area: Staging all the changes in the current directory, used to store information about the changes you submitted. You can think of the staging area as a preparation table where Git will make the next commit.
  • Branch: It is a new development line created, which is different from the main line of development. This alternative development route can be continued without changing the main line.

How to set up Git?

Download Git

  1. Open Git-scm.com
  2. Download Git Acc to the operating system
  3. Install Git select all default options

Open GitBash

Git configuration for the first time

# sets up Git with your name
git config --global user.name "<Your-Full-Name>"

# sets up Git with your email
git config --global user.email "<your-email-address>"

Create a new project. Open git bash in the project directory and initialize the project

git init

The git init command creates a new Git repository or initializes a new empty repository.

  • touch-used to create a new file
  • ls-used to list files and directories
  • mkdir-used to create a new directory
  • cd-used to change the directory
  • rm-used to delete files and directories

Create a web project

Create an index.html file

touch index.html

Create a javaScript file

touch main.html

Create a style.css file

touch style.css

View the Git status at this time

git status

image.png

submit

git add.
git commit-m "initial commit"

Commonly used git commands

image.png

点赞(0) 打赏

评论列表 共有 0 评论

暂无评论

微信服务号

微信客服

淘宝店铺

support@elephdev.com

发表
评论
Go
顶部