web开发课程2--Command line and Git

Last updated on August 4, 2024 pm

image-20240804145935038

go over Command line and use command lines to run some Git commands and learn about Git as well.

一、命令行语句

pwd:print working directory(当前工作目录)image-20240804150539650

rm file name:remove

touch f n:creat

mkdir folder name:creat a folder

image-20240804151036413

二、Git——A version-control system

(1)problems with coding in projects

  1. Synchronization(同步) of files (no one knows which file is the most up-to-date)
  2. Collaboration(合作) of files (if there are two version of the same file, both of them fix a different problem, it’s hard to know how to join the files)
  3. Version history (if we break something, we can’t go back to a working copy)

(2)what does git do?(基本原理)

track changes by doing math(computing the difference every time you make changes)

(3)some terminology(基本术语)

1.Repository—— a set of files to track changes on(git仓库)

2.Commit——a set of changes in a repository transitioning from one version to the next

3.Log——the set of commits for each version of the repository

  • commit (n.)- a packaged set of changes
  • push (v.)- to send commits to the git server
  • pull (V.)- to get most updated files from the git server

三、

git init

git status

git remote add origin https://github.com/Yaodeer/catbook-react(连接远程仓库)

git push

一些命令行语句:

GitHub Git Cheat Sheet - GitHub Cheatsheets

git clone了工程到电脑上并连接到了我自己的仓库,默认分支main:

git clone https://github.com/weblab-workshops/catbook-react.git


web开发课程2--Command line and Git
http://example.com/2024/08/04/web开发课程2--Command-line-and-Git/
Author
Yaodeer
Posted on
August 4, 2024
Licensed under