• 沒有找到結果。

Version contr ol

N/A
N/A
Protected

Academic year: 2022

Share "Version contr ol"

Copied!
19
0
0

加載中.... (立即查看全文)

全文

(1)

Michael Tsai 2011/5/5

(2)

Reference

http://betterexplained.com/articles/a-vis ual-guide-to-version-control

/

http://

www.ericsink.com/scm/source_control.html

http://betterexplained.com/articles/intro -to-distributed-version-control-illustrat ed/

(3)

Version control

Also called “source control”

Other alias

source configuration management

source code management

(4)

You have been doing it

Your own version control system:

KalidAzadResumeOct2006.doc

KalidAzadResumeMar2007.doc

instacalc-logo3.png

instacalc-logo4.png

logo-old.png

“Save as”: leave the old version intact.

Single backup file: Document.old.doc

Version number or date: Document_V1.doc

Share folder for other people to access/modify the fil e(s)

(5)

But it doesn’t scale

Imagine putting all the related files of a gigantic software project (e.g. WINDOWS 8) in a single shared folder, and have th ousands of developers accessing it.

NO WAY.

(6)

What does a version control sys tem do?

Backup and Restore. Files are saved as they ar e edited, and you can jump to any moment in ti me. Need that file as it was on Feb 23, 2007?

No problem.

Synchronization. Lets people share files and s tay up-to-date with the latest version.

Short-term undo. Monkeying with a file and mes sed it up? (That’s just like you, isn’t it?) . Throw away your changes and go back to the

“last known good” version in the database.

(7)

What does a version control sys tem do?

Long-term undo. Sometimes we mess up bad. Suppose you made a change a year ago, and it had a bug. Ju mp back to the old version, and see what change wa s made that day.

Track Changes. As files are updated, you can leave messages explaining why the change happened (store d in the VCS, not the file). This makes it easy to see how a file is evolving over time, and why.

Track Ownership. A VCS tags every change with the name of the person who made it. Helpful for blames torming giving credit.

(8)

What does a version control sys tem do?

Sandboxing, or insurance against yourself . Making a big change? You can make tempo rary changes in an isolated area, test an d work out the kinks before “checking in

” your changes.

Branching and merging. A larger sandbox.

You can branch a copy of your code into a separate area and modify it in isolation (tracking changes separately). Later, you can merge your work back into the common area.

(9)

Learn some terms

Server Client

Working copy Working

copy Repository

(file database) Trunk:

main

line v2_dev el v1_old_stabl

e

v3_new_te st

(10)

Main trunk

r3:

milk eggs juice

r4:

milk eggs soup Check out

Working copy:

milk eggs soup

Check in Revert

(11)

Main trunk

r1:

milk

r2:

milk eggs

r3:

milk eggs juice

r4:

milk eggs soup

+juice +eggs

-juice, +sou

p

????

(12)

Main trunk

r4:

milk eggs soup

New Features

r7:

milk eggs soup bread eggs

soup

eggs rice

(13)

Main trunk

r4:

milk eggs soup

New Features

r7:

milk eggs soup bread eggs

soup

eggs rice +rice

+brea d

r8:

milk eggs soup bread

rice +rice

(14)

Main trunk

r3:

milk eggs juice

r4:

milk cheese

juice

Working copy (r3*):

milk hot dog

juice Working

copy (r3*):

milk cheese

juice

-eggs +hot

dog e

Valid check-in

Conflicting check-in (cannot remove eggs)

(15)

How to resolve the conflict?

Re-apply your changes. Sync to the latest version (r4) and re-apply your changes to this file: Add hot dog to the list that a lready has cheese.

Override their changes with yours. Check out the latest version (r4), copy over yo ur version, and check your version in. In effect, this removes cheese and replaces it with hot dog.

(16)

Main trunk

r1:

milk

r2:

milk eggs

r3:

milk eggs juice

r4:

milk eggs soup

1.0 1.5 2.0

(17)

Main trunk IE

Window s MP 10

IE 6

Window s MP 10

IE 6

M11 s

MP 11 IE 6

IE7 s

MP 11 IE 7

Window s MP 10

IE 6

IE7

Window s MP 10

IE 7

MP1 1

Window s MP 11

IE 7

Window s MP 11

IE 7

MP RI FI

RI FI

(18)

How do I get started?

Try subversion. It’s free!

(not the fastest/fanciest/most powerful on the marke t, but it’s good enough for most projects)

Windows GUI for subversion: TortoiseSVN http://tortoisesvn.tigris.org/

Very easy to use!

Free book about subversion:

http://svnbook.red-bean.com/

We will have a homework for you next week (HW4-2)

Once you know how to use it, make it a habit (not ha rd at all).

(19)

Further reading

Distributed Version Control:

http://betterexplained.com/articles/intro -to-distributed-version-control-illustrat ed/

(don’t know if we will cover it this sem ester)

參考文獻

相關文件

2.1.1 The pre-primary educator must have specialised knowledge about the characteristics of child development before they can be responsive to the needs of children, set

Reading Task 6: Genre Structure and Language Features. • Now let’s look at how language features (e.g. sentence patterns) are connected to the structure

 Promote project learning, mathematical modeling, and problem-based learning to strengthen the ability to integrate and apply knowledge and skills, and make. calculated

Teachers may consider the school’s aims and conditions or even the language environment to select the most appropriate approach according to students’ need and ability; or develop

These programmes are operated by 11 degree-awarding self-financing institutions registered under the Post Secondary Colleges Ordinance (Cap. 320) or statutory

These activities provide chances for students to work on their own, to apply their economic concepts, to develop a critical attitude and, above all, to increase the interest of

This kind of algorithm has also been a powerful tool for solving many other optimization problems, including symmetric cone complementarity problems [15, 16, 20–22], symmetric

Starting from January 2006, the CPI has been rebased to July 2004 to June 2005, apart from the compilation of the Composite CPI that reflects the impacts of price changes for