What's the difference between Commit and Update?
Asked Answered
P

6

20

I am new to version control, and am not sure of the differences between using Commit vs Update when using ankhsvn.

What's the difference between a commit and update? When should I use one verses the other?

Pediment answered 2/5, 2012 at 8:31 Comment(3)
Sorry, dumb question! Didn't realize which direction the update went.Pediment
Ain't no dumb questions on this board, boy. The words used by SVN are vague. I kinda like "Update is called "Get latest" in TFS/Source Safe if I remember correct..." "Get Latest changes" would be better, still. Reminds me, I have to get back to my "still". Moonshine.Barefaced
Brand hot question and pointing to dangerous pitfall! I'm using SVN for some weeks now. Just a second ago, I was thinking, which menue entry to choose [UPDATE,COMMIT],for "writing back" the work of hours back to the repositry. I know COMMIT is doing the job. Curious as I am, I wondered if UPDATE would do a similar function.I just missed to use UPDATE by pure luck or due to a thiny rest of reluctance.The verb UPDATE ist really a bad choice here to describe it's function. The english language doesn't impose a direction with Update.Galwegian
L
18

Commit puts your changes into the repository.

Update gets the latest version from the repository.

Lindblad answered 2/5, 2012 at 8:35 Comment(0)
S
9

Update gets the latest from the repository onto your workspace.

Commit commits or checks in your changes into the repository.

Best practice is to do an Update first to get the latest so that you can merge the changes and resolve any conflicts with the code on your workspace.

You will be forced to do an update if there are changes in the repository when committing but its quicker to do it before trying to commit.

Shari answered 2/5, 2012 at 8:35 Comment(0)
M
5

Commit = Commit/confirm your changes to the repository. Update = Get the latest version/changes from the repository.

When you change a file and want to keep the changes, commit them to the repository.

When you want to get the latest available version/s from the repository, use update to update your local files.

I hope this clear things out for you.

Update is called "Get latest" in TFS/Source Safe if I remember correct...

/Fred

Middleman answered 2/5, 2012 at 8:35 Comment(0)
R
4

A commit will upload your changed files to the repository and create a revision. Whereas an update will download any revisions from the repository into your local copy.

Return answered 2/5, 2012 at 8:34 Comment(0)
F
4

Commit uploads your changes on the CVS / SVN server, and Update overwrites the files on your localhost with the ones on the server.

Folderol answered 2/5, 2012 at 8:35 Comment(0)
S
3

This is very very basic SVN stuff. Read the SVN book, or at least the chapter about fundamental concepts and basic usage.

Update means: "take all the new stuff in the repository and apply them in my working copy".

Commit means: "take all the changes I've made in my working copy and apply them in the repository"

Scorbutic answered 2/5, 2012 at 8:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.