git和github
说明
Git,开源的分布式版本控制系统,可以有效的、高速的处理从很小到很大的项目版本管理。
GitHub, 是一个面向开源及私有软件项目的托管平台,因为只支持 Git 作为唯一的版本库格式进行托管,故名 GitHub。
安装
可以直接在官方网址点击下载安装: https://git-scm.com/
基本设置
git config --global user.name "你的用户名"
git config --global user.email "你的邮箱"
github账号注册
https://github.com/join?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&source=header-homehttps://github.com/join?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&source=header-home
SSH KEYS生成
ssh-keygen -t rsa -C "你使用的邮箱"
基础命令<br>
git add * (或者文件名)<br>
git commit -m "提交备注"<br>
git remote add origin https://github.com/你的github用户名/仓库名.git
git push -u origin master
git log
git reflog
git reset --hard commit id
git restore 文件名
git rm 删除的文件名
git clone 项目仓库地址
git pull
git branch 分支的名字
git branch<br>
git checkout 具体分支名
git merge 分支名<br>
git branch -d 分支名
git checkout -b 分支名
git switch -c 分支名