From 57c3a33ebf173f06fe2e206c0dc3a2cf9aac3b4b Mon Sep 17 00:00:00 2001 From: Cameron McEfee Date: Fri, 25 Feb 2011 18:03:51 -0800 Subject: updated social --- _posts/2011-02-17-fork-a-repo.markdown | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '_posts/2011-02-17-fork-a-repo.markdown') diff --git a/_posts/2011-02-17-fork-a-repo.markdown b/_posts/2011-02-17-fork-a-repo.markdown index 0ae782d..8cc493a 100644 --- a/_posts/2011-02-17-fork-a-repo.markdown +++ b/_posts/2011-02-17-fork-a-repo.markdown @@ -65,20 +65,20 @@ You’ve successfully forked a repo, but get a load of these other cool thin

What is the difference between fetch and pull?

- There are two ways to get changes from a remote repo or branch: fetch and pull. While they might seem similar at first, there are distinct differences you should consider. + There are two ways to get commits from a remote repo or branch: fetch and pull. While they might seem similar at first, there are distinct differences you should consider.

Pull

-					$ git pull upstreamPulls changes from upstream and adds them to the local repo
+					$ git pull upstreamPulls commits from 'upstream' and adds them to the local repo
 				
-

When you use pull, Git tries to automatically do your work for you. It is context sensitive, so Git will apply any pulled changes to the branch you are currently working in. One thing to keep in mind is that pull automatically applies the changes without letting you review them first. If you don't closely manage your branches you may run into frequent conflicts.

+

When you use pull, Git tries to automatically do your work for you. It is context sensitive, so Git will merge any pulled commits into the branch you are currently working in. One thing to keep in mind is that pull automatically merges the commits without letting you review them first. If you don’t closely manage your branches you may run into frequent conflicts.

Fetch/Merge

-					$ git fetch upstreamFetches any new changes from the original repo
-					$ git merge upstream/masterMerges any changes fetched into your working files
+					$ git fetch upstreamFetches any new commits from the original repo
+					$ git merge upstream/masterMerges any commits fetched into your working files
 				
-

When you fetch, Git downloads any changes from the specified branch, but does not apply them to your files. This is very useful if you need to keep your repo up to date but are working on something that might break if your files are updated. To apply the changes, you use merge. This combines the specified branches and prompts you if there are any conflicts.

+

When you fetch, Git gathers any commits from the target branch that do not exist in your current branch and stores them in your local repo. However, it does not merge them with your current branch. This is particularly useful if you need to keep your repo up to date but are working on something that might break if you update your files. To integrate the commits into your master branch, you use merge. This combines the specified branches and prompts you if there are any conflicts.

-- cgit v1.3.1