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入门
Search
xautjzd
September 16, 2013
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git入门
xautjzd
September 16, 2013
Transcript
14 slides
GIT入门 —— xautjzd A DISTRIBUTED VERSION CONTROL SYSTEM
Git 最初被Linus Torvalds设计用来管理 Linux 内核代码 现在很多项目都采用Git管理,如Android、Ruby、 Eclipse、jQuery、PHP、Perl、PostgreSQL等 Git开源免费,采用GPL 发布 Git概述
VCS分类 集中式版本控制器,eg:SVN 分布式版本控制器, eg: Git
共同点 随时回溯到之前的状态 回退到任何时间点 比较文件变化的细节 追溯代码修改作者 快速恢复文件
不同点 SVN:单点故障 Git: 操作更简单,体积更小,无 需网络,速度更快
Git演示——下载 下载地址: http://git-scm.com/downloads
Git演示——配置 系统配置(系统有效) /etc/gitconfig,git config --system 用户配置(当前用户有效) ~/.gitconfig, git config --global
项目配置(当前项目有效) .git/config, git config 查看配置信息 git config --list
Git演示——三种状态
Git演示——基本操作 •git init ——初始化repository •git clone ——克隆repository •git status ——
查看当前文件状态 •git add ——跟踪文件 •git commit ——提交文件 •git commit --amend ——撤销提交操作并重新提交 •.gitignore ——忽略某些文件,如编译生成的临时文件
Git演示——基本操作 •git rm ——删除文工作区和暂存区文件 •git rm -cached —— 删除repository和暂存区的文件而不删除 工作区文件,此操作是为了删除那些误纳入版本库的文件
•git diff ——对比工作区和暂存区 •git diff --cached ——对比暂存区和本地repository •git diff HEAD ——对比工作区和本地repository •git show HEAD ——查看当HEAD版本更新细节 •git log ——查看提交历史记录(-p显示提交的内容差异,而-n 则 显示最近n次的更新)
Git演示——基本操作 •git reset HEAD file ——取消暂存的文件 •git checkout --file ——取消文件的修改(还原文件)
•git checkout <commit version> filename——撤销到历史某一版本 •git remote -v ——查看远程仓库的配置 •git remote add ——配置远程仓库 •git pull —— 获取远程仓库而本地没有的数据(git fetch和git merge) •git push ——推送代码到远程仓库
Git演示——基本操作 •git branch branchname ——新建分支 •git checkout -b branchname ——新建分支并切换到该分支
参考资料 http://git-scm.com/book/zh/ https://github.com/progit/progit/tree/master/zh http://gitbook.liuhui998.com/
谢谢观赏 THANKS FOR YOUR READ THE END
More Decks by xautjzd
See All by xautjzd
Introduction to Cloud Computing
xautjzd
0
66
ASP.NET MVC Model First
xautjzd
0
63
Other Decks in Programming
See All in Programming
Distance field of Julia set
kinakomoti321
0
330
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
AI駆動TDD ― 2026年10月版
hrmstrsmgs
0
110
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
340
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
190
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
660
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
330
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
270
[DroidKnights 2026] Workflow AX 적용기 — 자동 정책 정리부터 E2E까지
dayeon
0
120
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
440
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
860
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Building an army of robots
kneath
307
47k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
310
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.5k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
61k
How to Ace a Technical Interview
jacobian
280
24k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k