1.基本介紹html
Linus Torvalds 爲了存儲linux源碼,創造的一套分佈式版本控制系統。linux
2.好處:git
3.git 、GitHub、GitLab區別(以前一直沒聯繫上這3個名詞)github
4.Git推送代碼兩種方式服務器
第一種:網絡
git clone git@github.com:XXX/blogs.git 生成項目名blogs文件夾,此文件夾下有.git文件夾ssh
在項目文件夾blogs下建立文件index.html分佈式
(1)git add . 或 git add index.html 文件上傳到工做區 工具
(2)git commit -m 'fix' 提交到【暫存區】版本控制
(3)git push 推送到遠程倉庫 不寫默認是主分支
第二種:
1.cd blogs
2.git init 初始化一個空的遠程倉庫,有默認配置信息 .git等
3.推送
建立和github溝通橋樑 git remote add orgin_ssh git@github.comXXX.git
推送到遠程 git push origin_ssh master
5.查看歷史版本號 :git log
6. 版本回退 git reset --hard XXX XXX表示版本號
寫的不全,只是經常使用的一些命令,下面是大佬博客傳送門:https://www.liaoxuefeng.com/wiki/896043488029600/897013573512192