git版本控制器
VCS:Version Control System版本控制系統
1.記錄文件的歷史變化
2.隨時可以恢復到任何歷史狀態
3.多人協作開發或修改
4.錯誤恢復
5.多功能并行開發????--SVN中的分支功能
repository ????--存放所有文件及其歷史信息
checkout ????--取出或切換到指定版本的文件
version ????--記錄標識一個版本(編號或者其他版本)
tag ????????????
--記錄標識一個主要版本(1.0 2.0 3.0)里程碑版本
LVCS :本地版本控制系統
CVCS :集中化版本控制系統
DVCS :分布式版本控制系統
LVCS:使用本地硬盤即可存儲,不支持網絡功能。
????如:RCS軟件
CVCS:只支持網絡,服務器上保存完整的文件
????如:CVS,SVN軟件
????單點故障是指CVCS服務器出現故障,那么其它的操作都不能工作
DVCS
????分布式:每個計算機都有一套完整的版本控制器。(分布式是不是類似鏡像的意思???)
分布式與集中式的概念
git版本控制系統
git的取名有點小意思????first“Linux”now“git”
git的原理:保存快照,而非區別
git的所有操作都是在本地執行的,多數操作均為添加操作
git的3種工作區域
????1.working directory
????2.staging area
????3.git repository
在working區編輯,修改文件..然后暫存到staging 區域..最終提交到 git repository形成一本新的版本,并且對他人可見
安裝git
????yum install -y git
查看git的版本信息????
????yum --version ??
設置基本信息:
????主要是為了區分這個文件都是由誰誰誰提交的
????--global是表示對全局倉庫生效的
創建倉庫
????git init 初始化之后會生成.git隱藏文件...然后所有的文件都保存在這個.git文件里面
????
添加文件:將文件從 工作區域 先添加到了 暫存區域? ??
????git status? ???
????git add readme.txt????--單個文件
????git add *?????????????--添加所有文件
????git commit -m "init repo"????--將 暫存區域 的文件 提交到 git倉庫區域
????git status ?
????[root@localhost?IterCast-Demo]#?git?status????#?On?branch?master##?Initial?commit##?Untracked?files:#???(use?"git?add?<file>..."?to?include?in?what?will?be?committed)## README# hellogit.rbnothing?added?to?commit?but?untracked?files?present?(use?"git?add"?to?track)[root@localhost?IterCast-Demo]#Untracked?表示?文件還在工作目錄...[root@localhost?IterCast-Demo]#?git?add?README? [root@localhost?IterCast-Demo]#?git?add?hellogit.rb? [root@localhost?IterCast-Demo]#?git?status #?On?branch?master # #?Initial?commit # #?Changes?to?be?committed: #???(use?"git?rm?--cached?<file>..."?to?unstage) # # new?file:???README # new?file:???hellogit.rb # [root@localhost?IterCast-Demo]#commit表示文件已在 暫存區,但未提交到 git倉庫
git commit -m "this is first use git"????
[root@localhost IterCast-Demo]# git commit -m "this is first use git "
[master (root-commit) e45a891] this is first use git
?0 files changed, 0 insertions(+), 0 deletions(-)
?create mode 100644 README
?create mode 100644 hellogit.rb
[root@localhost IterCast-Demo]#?
轉載于:https://blog.51cto.com/panzhengming/1607175
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
- 上一篇: Cocos2d-x Lua中实例:帧动画
- 下一篇: 笔记10:时时屏幕抓取小程序