Top Banner
ইአgit
36

Git Presentation(Chinese)

Jan 14, 2017

Download

Engineering

Ryan Wang
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Git Presentation(Chinese)

git

Page 2: Git Presentation(Chinese)

git

• Linus

• git : git, linux, RoR

Page 3: Git Presentation(Chinese)
Page 4: Git Presentation(Chinese)

git vs svn• -> iPhone

• vs

• branch tag

Page 5: Git Presentation(Chinese)
Page 6: Git Presentation(Chinese)

git

• branch/tag

• head

• master

• staging index/repo/working copy

• origin

Page 7: Git Presentation(Chinese)

stage

Page 8: Git Presentation(Chinese)
Page 9: Git Presentation(Chinese)
Page 10: Git Presentation(Chinese)

git

• git clone

• git add .

• git commit [-a][—amend]

• git pull origin master

• git push origin master

Page 11: Git Presentation(Chinese)

git

Page 12: Git Presentation(Chinese)

Configuration• git config —list

• git config [—global] user.name aelam

• git config user.email [email protected]

• ignore

• system, global, project

• alias

Page 13: Git Presentation(Chinese)

.gitconfig

Page 14: Git Presentation(Chinese)

.gitignore

Page 15: Git Presentation(Chinese)

Create

• git init

• git clone

Page 16: Git Presentation(Chinese)

Branches & Tags

• git branch [-d][-D] new_branch

• git checkout new_branch

• git tag [-d][-D] 1.0

• git checkout 1.0

Page 17: Git Presentation(Chinese)

Merge&Rebase

• git checkout master

• git merge a_branch

• git rebase [—continue][—abort]

Page 18: Git Presentation(Chinese)

Merge&Rebase

Page 19: Git Presentation(Chinese)

rebase merge

Page 20: Git Presentation(Chinese)

rebase merge 2

Page 21: Git Presentation(Chinese)

Update & Publish

• git pull origin master [—rebase][—tags]

• git pull origin a_tag

• git push origin master

• pull = fetch + merge

• ? git push new_server master

Page 22: Git Presentation(Chinese)
Page 23: Git Presentation(Chinese)

• git reset HEAD~3 — file_path

• git checkout HEAD~3 — file_path

Page 24: Git Presentation(Chinese)

rebase merge

• git pull origin master —rebase [git rebase origin master]

• git pull origin master git merge origin master

Page 25: Git Presentation(Chinese)

tag branch

Page 26: Git Presentation(Chinese)

SourcTree rebase merge

Page 27: Git Presentation(Chinese)

Tower rebase merge

Page 28: Git Presentation(Chinese)

• .gitignore

• git rm —cached -r Pods/

Page 29: Git Presentation(Chinese)

rebase/merge

• git checkout —thiers file_path

• git checkout —ours file_path

Page 30: Git Presentation(Chinese)

reset

• git reset —hard HEAD

• git reset HEAD^^

• git reset HEAD~2

Page 31: Git Presentation(Chinese)

git with svn

• git svn clone

• git svn rebase * !!rebase commit

• git svn dcommit

Page 32: Git Presentation(Chinese)

git submodule

• git submodule add /path/to/Vendors

• git submodule init

• git submodule update

Page 33: Git Presentation(Chinese)

git

• github 5

• bitbucket 5

Page 34: Git Presentation(Chinese)

git GUI

• github

• gitx

• SourceTree

• Tower

Page 35: Git Presentation(Chinese)

dotfiles

Page 36: Git Presentation(Chinese)

Ref

• gitcheatsheet https://github.com/AlexZeitler/gitcheatsheet/blob/master/gitcheatsheet.pdf