Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Will pull only merge the changes to local repository?

Fangfang Liu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 11, 2017

I am new to Source tree and Git. I am trying to understand what is the difference between Git and SVN. Someone told me that Git will take a full snapshot of the whole project instead of just for the increment files. So for example, when someone  pushed code change for file A to remote repository and I need to pull them to my local, if in my local repository, I didn't touch file A but changed the file B, would there be a conflict for  file B? Will source tree overwrite my file B with remote repository's original file B? Thanks.

1 answer

1 accepted

0 votes
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2017

The someone told you wrong. They mixed up two separate differences between git and SVN.

First, an individual git commit doesn't store the whole project. The difference they were referring to is that, for each file that has been modified, a commit in git stores the entire file, while SVN stores a diff. Unchanged files aren't included in the commit data.

That shouldn't make make much of a difference to a typical user though. The git software still calculates diffs when merging, and it also has a mechanism to compress commit data so it doesn't take up unreasonably more space than SVN commit data.

Secondly, when you clone a repository in Git, it copies the ENTIRE REPOSITORY to your machine, while SVN just copies a set of files that are associated with a particular branch. This means that you can do local operations (create/switch/delete branches, commit, tag) without connecting to the remote repository. The operations Push, Pull, and Fetch are used to keep your local repository in sync with remote ones.

To really understand the differences, check out the Git Book: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics It describes all of that information very clearly, with simple examples. The git book uses git commands (not SourceTree or any other UI), but the commands typically pair directly with SourceTree terms ("git fetch" is the Fetch button, "git commit" is the Commit button, etc).

Fangfang Liu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 11, 2017

It helps. Thank you. I will take a look at the Git book. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events