创建Git仓库
git init
如果想删除Git仓库(比如在错误的文件夹下创建了Git)
rm -rf .git
检查Git状态(Checking your Git repository status)
git status
添加文件到Git repository,也可以把后面的点换成具体的文件(To add files to the staging area of your Git repository)
git add .
撤销add(undo add)
git reset <file>
git reset
提交内容到Git仓库(commit the current staging area to your Git repository)
git commit -m "first commit"
查看commit的历史记录
git log
git log --oneline
添加online Git repository
git remote add origin <repository URL>
将本地的更新Push到online Git repository(注意原先主分支叫master,现在变成了main)
git push -u origin main
克隆online repository
git clone <repository URL>