Git Presentation(Chinese)

36
ইአgit

Transcript of Git Presentation(Chinese)

git

git

• Linus

• git : git, linux, RoR

git vs svn• -> iPhone

• vs

• branch tag

git

• branch/tag

• head

• master

• staging index/repo/working copy

• origin

stage

git

• git clone

• git add .

• git commit [-a][—amend]

• git pull origin master

• git push origin master

git

Configuration• git config —list

• git config [—global] user.name aelam

• git config user.email [email protected]

• ignore

• system, global, project

• alias

.gitconfig

.gitignore

Create

• git init

• git clone

Branches & Tags

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

• git checkout new_branch

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

• git checkout 1.0

Merge&Rebase

• git checkout master

• git merge a_branch

• git rebase [—continue][—abort]

Merge&Rebase

rebase merge

rebase merge 2

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

• git reset HEAD~3 — file_path

• git checkout HEAD~3 — file_path

rebase merge

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

• git pull origin master git merge origin master

tag branch

SourcTree rebase merge

Tower rebase merge

• .gitignore

• git rm —cached -r Pods/

rebase/merge

• git checkout —thiers file_path

• git checkout —ours file_path

reset

• git reset —hard HEAD

• git reset HEAD^^

• git reset HEAD~2

git with svn

• git svn clone

• git svn rebase * !!rebase commit

• git svn dcommit

git submodule

• git submodule add /path/to/Vendors

• git submodule init

• git submodule update

git

• github 5

• bitbucket 5

git GUI

• github

• gitx

• SourceTree

• Tower

dotfiles

Ref

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