web开发课程2--Command line and Git
Last updated on August 4, 2024 pm
go over Command line and use command lines to run some Git commands and learn about Git as well.
一、命令行语句
pwd:print working directory(当前工作目录)
rm file name:remove
touch f n:creat
mkdir folder name:creat a folder
二、Git——A version-control system
(1)problems with coding in projects
- Synchronization(同步) of files (no one knows which file is the most up-to-date)
- 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)
- 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