do you want to use a vcs

Post on 10-May-2015

268 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Short introduction about vcs & git usage. Aimed to introduce concept of version control system and git to people who didn't used git or vcs yet. Doesn't introduce deep part of git or operating policy for git. Just focus on simple introduction about main functionality and abstracted internal design.

TRANSCRIPT

DO YOU WANNA USE A VCSSeongJae Park <sj38.park@gmail.com>

Software Is Alive: Keeps Changing

“How To Keep Software’s Moment?”

Life Of Files

FileA ver 0 FileB ver 0

Life Of Files

FileB Changed

FileA ver 0 FileB ver 1

Life Of Files

FileA Changed

FileB ver 1 FileA ver 1

Life Of Files

FileB Changed Again

FileB ver 2FileA ver 1

Software Is Alive: Keeps Changing

“How To Keep Software’s Moment?”

$ ls0213_1st.tar0239_2nd.tar.gzip0305_final.zip0307_final2.alz

VCS: Version Control System

Help Versioning, History Managing

VCS: Version Control System

Help Versioning, History Managing

Get Back Specific Version’s Software Anytime

CVCS vs DVCS

Centralized vs Distributed

Not Detail This Time…

Just Remember, CVCS is EVIL

git

Distributed Version Control System

Developed For Kernel SCM By Linus Torvalds“Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it ;)” - Linus Torvalds

Just Remember: Cool Programmer Uses GIT

GIT, ALONE AND FREE“Yes, I’m Alone, But I’m Alone And Free”

- Frozen -

git init: Create Repository

$ mkdir olaf && cd olaf && git init

`pwd` Is Now A Git Repository

Can Version Control Files Inside `pwd` Now

git add: Add Files Under Git’s Admin

$ echo “warmhug” > favor && git add favor

They Will Be One Of Version Later

git status: Show Git’s Admin Status

$ git status

$ echo “anna” >> favor

$ git status

Changed? Deleted? Be Conflicted?

git commit: Make Version

$ git commit -m “add warmhug as favor”

Already Added Files Are New Version, Now

git log: Show History

● Development Cycle○ While(!blamed) {Analysis(); Develop(); Blame();}

Useful For Blaming ;)

git branch: Manage Branches

git branch;

git branch more_favor;

git branch;

git checkout: Move To Other Branch

git checkout more_favor

git branch

git commit -am “add anna as favor, too”

git log

git checkout master

git log

git checkout: Move To Commit

$ git checkout d8ec26

Branch Is Just Name Of Ref To Commit

Life Of Files Under Git, Internal

FileA ver 0 FileB ver 0

git commit

FileA ver 0 FileB ver 0

commit 1

Life Of Files Under Git, Internal

git branch

FileA ver 0 FileB ver 0

commit 1

master branch

Life Of Files Under Git, InternalHEAD

FileB Changed

FileA ver 0 FileB ver 0 FileB ver 1

commit 1

master branch

Life Of Files Under Git, InternalHEAD

git commit -a

FileA ver 0 FileB ver 0 FileB ver 1

commit 1 commit 2

master branch

Life Of Files Under Git, InternalHEAD

git commit -a

FileA ver 0 FileB ver 0 FileB ver 1

commit 1 commit 2

master branch

Life Of Files Under Git, InternalHEAD

Change FileA, FileBgit commit -a

FileA ver 0 FileA ver 1FileB ver 0 FileB ver 1 FileB ver 2

commit 1 commit 2 commit 3

master branch

Life Of Files Under Git, InternalHEAD

git checkout -b newbranch

FileA ver 0 FileA ver 1FileB ver 0 FileB ver 1

commit 1 commit 2 commit 3

master branch newbranch

FileB ver 2

Life Of Files Under Git, InternalHEAD

Change FileAgit commit -a

FileA ver 0 FileA ver 1FileB ver 0 FileB ver 1 FileB ver 2

commit 1 commit 2 commit 3

master branch

FileA ver 2

commit 4

newbranch

Life Of Files Under Git, InternalHEAD

GIT IS AN OPEN DOOR“We Can Fix This Hand In Hand”

- Frozen -

Communication Between Repos

Git Repositories Can…ClonePush Commits ToPull Commits FromEach Others

Protocol Between Repos

HTTP://HTTPS://GIT://SSH://

Even Usual File System

git clone: Clone Other’s Repo

$ git clone /home/elsa/olaf

git remote: Manage Remote Repos

$ git remote

$ git remote add origin /home/elsa/olaf

git push: Push Changes To Remote

$ echo “carrot” > noise && git add noise \

&& git commit -am “add noise”

$ git push

git pull: Fetch & Merge Changes

May Cause Conflict In Some Scenario

Remember To Make Things Clean Before Push

Free GIT Repo Hosting Service

● GitHub○ Popular Service○ Money For Private Repository

● Bitbucket○ Less Than GitHub, But Popular○ No Money For Private Repository

FAQ: When Commit?

One Commit For One Logical Change

FAQ: How To Revert?

git reset --soft HEAD^

FAQ: How To Revert Silently?

$ git reset --hard HEAD^

FAQ: Howto @#$@!%^?

Sorry, Next Time…

IT’s TIME TO SEEWhat You Can Do

To Test The Limit And Breakthrough

top related