20150313 ian git

Download 20150313 ian git

Post on 15-Jul-2015

117 views

Category:

Technology

3 download

Embed Size (px)

TRANSCRIPT

Google reCAPTHA and FB Like Box

Git IntroductionIanGit

(local repository) Git blob Git HTTP, FTP, rsync, SSH Git protocol commit hash id

"" "" Git "" (packfile)

2Git tool for windowsGit for WindowsGitHub for WindowsSourceTreeGit Git Shell local repository git init

GitHub remote repository git clone [repository url]4 Git git add . git reset git status Untracked () Staged ()

5/ git commit git commit m

git log [-log size] git rm fileName git mv oldName NewName

Reset current working directory git reset --hard

Undo file git checkout master fileNameGit status

Git status

untracked ( Git )unmodified ( HEAD )modified ( HEAD )staged ( commit git commit )

10git statusChanges to be committed () Changes not staged for commit () Untracked files ()

PS. .gitignore (.gitignorecommit!)

11Object SHA1 SHA1 (tree object)(blob object) (object storage)

12Objectblob tree blob (symbolic link) tree tree tree tree

Objectcommit tree commit Git tree tag commit ( blobtree )(metadata): tag tag commit

Index .git index commit Git Working directoryRepository(mkdir, git init)Working directory... Git Repositoryindex(git add, git mv, ...) Git index Git Repository(git status) (git commit) ( commit )

Branchgit branchgit branch [branch_name]git checkout -b [branch_name]git checkout [branch_name]git branch -d [branch_name]

PullPull - git pull git pull origin master

git fetch branch branch merge merge commit PushPush - Commit git push git push origin master master branch master branch fast-forward [rejected] pullReferencehttps://github.com/doggy8088/Learn-Git-in-30-dayshttp://oolab.csie.ncu.edu.tw/wiki/images/e/e7/Giteveryone-101022053442-phpapp02.pdfhttp://dylandy.github.io/Easy-Git-Tutorial/index.html