SlideShare a Scribd company logo
1 of 9
Download to read offline
Git使⽤用进阶
最佳实践,我总结的
议题
• 前⾔言
• 使⽤用别名(alias)
• git pull --rebase(rebase) OVER git pull(merge)
• 保持代码库清爽 git ignore
• 其它⼯工具,让mac⻜飞
前⾔言
• 刻意练习,熟练到精通
• 会练习
• 勿眼⾼高⼿手低
• DRY,极客范
• 熟练使⽤用命令⾏行
• ⾃自动化
别名alias
• 命令⾏行的alias
• gs = git status
• gc = git commit
• git的alias
• git st = git status
• git ci = git commit
• git co = git checkout
git pull --rebase
• git两种合并代码的⽅方式
• rebase
• merge
• 分⽀支曲线
git pull --rebase
• git两种合并代码的⽅方式
• rebase
• merge
• 分⽀支曲线 - merge
git pull --rebase
• git两种合并代码的⽅方式
• rebase
• merge
• 分⽀支曲线 - rebase
• rebase更清爽
• git允许指定不提交的⽂文件
• 创建并编辑.gitignore⽂文件
• 使⽤用git ignore命令(需要最新版本的git),或者单独安装
• android studio安装git ignore插件
• 不要把IDE的配置⽂文件提交
• 不要提交编译产⽣生的⼆二进制⽂文件
git ignore
其它⼯工具
• Homebrew (http://brew.sh)
• mac上的包管理⼯工具,可以⼀一键安装如nodejs,ruby等程
序,开发必备
• oh-my-zsh(http://ohmyz.sh)
• ⾮非常强的终端⼯工具,可以设置多种不同的主题
• 推荐插件,git, mac osx, autojump

More Related Content

What's hot

Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)Cloud Tu
 
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀Wen-Tien Chang
 
工程師必備第一工具 - Git
工程師必備第一工具 - Git工程師必備第一工具 - Git
工程師必備第一工具 - GitAlan Tsai
 
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹PingLun Liao
 
Git 入門與實作
Git 入門與實作Git 入門與實作
Git 入門與實作奕浦 郭
 
連哈秋都懂的Git教學
連哈秋都懂的Git教學連哈秋都懂的Git教學
連哈秋都懂的Git教學hydai
 
寫給大家的 Git 教學
寫給大家的 Git 教學寫給大家的 Git 教學
寫給大家的 Git 教學littlebtc
 

What's hot (8)

Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)
 
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀
 
Git Tutorial 教學
Git Tutorial 教學Git Tutorial 教學
Git Tutorial 教學
 
工程師必備第一工具 - Git
工程師必備第一工具 - Git工程師必備第一工具 - Git
工程師必備第一工具 - Git
 
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹
 
Git 入門與實作
Git 入門與實作Git 入門與實作
Git 入門與實作
 
連哈秋都懂的Git教學
連哈秋都懂的Git教學連哈秋都懂的Git教學
連哈秋都懂的Git教學
 
寫給大家的 Git 教學
寫給大家的 Git 教學寫給大家的 Git 教學
寫給大家的 Git 教學
 

Similar to Git使用进阶

Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)flylon
 
Git introduction
Git introductionGit introduction
Git introductionmythnc
 
Add mailinglist command to gitolite
Add mailinglist command to gitoliteAdd mailinglist command to gitolite
Add mailinglist command to gitolite琛琳 饶
 
COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報Bachue Zhou
 
Github简介及实用入门
Github简介及实用入门Github简介及实用入门
Github简介及实用入门Rongxing Liu
 
Git Flow 管理
Git Flow 管理Git Flow 管理
Git Flow 管理Pu Lee
 
Git 入门实战
Git 入门实战Git 入门实战
Git 入门实战icy leaf
 
Git基礎介紹
Git基礎介紹Git基礎介紹
Git基礎介紹Max Ma
 
Git & git hub v1.2
Git & git hub v1.2Git & git hub v1.2
Git & git hub v1.2Chris Chen
 
Git and git hub
Git and git hubGit and git hub
Git and git hub唯 李
 
Git flow 與團隊合作
Git flow 與團隊合作Git flow 與團隊合作
Git flow 與團隊合作Bo-Yi Wu
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshellNelson Tai
 
Git & git flow
Git & git flowGit & git flow
Git & git flowAmo Wu
 
Git使用入门
Git使用入门Git使用入门
Git使用入门dpf2e
 
First meetingwithgit
First meetingwithgitFirst meetingwithgit
First meetingwithgitRhythm Sun
 
20170510 git 懶人包
20170510 git 懶人包20170510 git 懶人包
20170510 git 懶人包Chen-Ming Yang
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to gitBo-Yi Wu
 
Yet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom upYet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom upWen-Tien Chang
 

Similar to Git使用进阶 (20)

Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)
 
Git introduction
Git introductionGit introduction
Git introduction
 
Add mailinglist command to gitolite
Add mailinglist command to gitoliteAdd mailinglist command to gitolite
Add mailinglist command to gitolite
 
COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報
 
Github简介及实用入门
Github简介及实用入门Github简介及实用入门
Github简介及实用入门
 
Git Flow 管理
Git Flow 管理Git Flow 管理
Git Flow 管理
 
Git 入门实战
Git 入门实战Git 入门实战
Git 入门实战
 
Git基礎介紹
Git基礎介紹Git基礎介紹
Git基礎介紹
 
Git & git hub v1.2
Git & git hub v1.2Git & git hub v1.2
Git & git hub v1.2
 
Git教學
Git教學Git教學
Git教學
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
Git flow 與團隊合作
Git flow 與團隊合作Git flow 與團隊合作
Git flow 與團隊合作
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
 
Git & git flow
Git & git flowGit & git flow
Git & git flow
 
Git使用入门
Git使用入门Git使用入门
Git使用入门
 
First meetingwithgit
First meetingwithgitFirst meetingwithgit
First meetingwithgit
 
20170510 git 懶人包
20170510 git 懶人包20170510 git 懶人包
20170510 git 懶人包
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Yet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom upYet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom up
 

Git使用进阶