Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Git_分享.pdf
Search
leohxj
March 08, 2013
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git_分享.pdf
leohxj
March 08, 2013
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
410
How GitHub (no longer) Works
holman
316
150k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Designing for Performance
lara
612
70k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
580
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
We Have a Design System, Now What?
morganepeng
55
8.4k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
The Pragmatic Product Professional
lauravandoore
37
7.5k
Technical Leadership for Architectural Decision Making
baasie
3
600
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
410
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Transcript
基于git的版本 控制 与开源实践 Michael Ding <yandy.ding(AT)gmail.com>
不得不提的版本控制 § 没有版本控制的日子。。。 § 存储 § 备份 § 比较 §
合并 § 好吧,我们需要版本控制。。。
著名的版本控制系统 § 集中式 § CVS § SVN § 分布式 §
Mercurial(Hg) § Git § 今天的主角 § Linus的第二个伟大作品 § 版本控制系统中的瑞士军刀
快速上手Git
Git中的版本 来自progit(http://progit.org)
Git项目库的3个组成 来自progit(http://progit.org) git add git commit git checkout
工作目录(working directory) 的操作 来自progit(http://progit.org)
缓存区(staging area)的操作 § git status § git diff § git commit
git版本库(repository)的操作 https://geakit.com git log git branch git tag
First of all:配置你的git § git config § /etc/gitconfig --system §
$HOME/.gitconfig --global § .git/config § 常用配置内容 § user.name, user.email § color.ui § core.editor § merge.tool
深入git内部机制
版本库的组织-版本(commit) 来自progit(http://progit.org)
版本库的组织-分支(branch) 来自progit(http://progit.org)
Git远程版本库 和Git服务器
Git远程版本库 § 远程版本库(remote)用于与存储在其他地方的 git版本库交互 § 一个远程版本库保存了存取地址(可以是文件夹 路径,url等等),通过这个地址,可以找到另一 个git版本库 § 远程版本库的建立就是,保存这样一个存取地址,
并给它取个名字 § 一个远程版本库同样可以包含多个远程分支 § 远程分支和本地分支一样,是指向具体版本 (commit)的指针 § 交互过程就是根据双方的分支,将两边版本库中 所有可以遍历到的版本进行同步,再更新相应的 分支指针
Git服务器 § Git的工作原理不依赖于服务器 § Git server的本质是方便版本库之间的交互 § U盘就可以作为一个最简单的Git server §
如果你需要权限控制,自动化管理,或者异 地(这里的异地指U盘连接不到的两地)交互等 等,还是需要尝试搭建server,或者使用第 三方的server服务供应商 § 主要git服务提供商: § 国外 github, bitbucket, gitorious, google code § 国内 geakit
git工作流 分布式工作流
传统(集中式)工作流
git工作流
Git与开源
§ 分布式的工作流,极大地方便了开源项目的参与(尤其是 新人)。可以先Hack,再审核 § Git是天生的内容管理工具,其实不光是代码,只要是文 本,都可以通过Git来实现有效的管理。尤其是有协作需 求的时候 § 我们(Geakit.com)是带有公益性质的创业。虽说开源在 中国已成燎原之势,然而由于中国教育的特殊性,作为
学生中的一员,我深切体会到这个群体对开源的认识还 很不足,我们就是想通过自己的努力,来尽可能地改善 这个现状。 § 当然我们也希望通过自己的努力,让更多的人了解到Git 能带给我们的便捷,进而甚至于参与到实实在在的开源 项目中去。