Skip to content

Commit

Permalink
Merge pull request #26 from scyrock/main
Browse files Browse the repository at this point in the history
FAQ Q012 introduced, ottimo!
  • Loading branch information
edoardocolella authored Dec 13, 2023
2 parents 47699d4 + c7b46e4 commit 64edc52
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/FAQ/Part1.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ How do you merge branches in Git?

### FAQ012
What is the difference between "fetch" and "pull" in Git?
In Git, "fetch" and "pull" are two related but distinct commands:

1. **Fetch:**
- The `git fetch` command is used to retrieve changes from a remote repository without merging them into your local branches.
- It downloads new branches and updates existing ones from the remote repository but does not automatically merge the changes into your working directory.
- Fetching allows you to see what changes are available in the remote repository and decide when to integrate them into your local branches.

2. **Pull:**
- The `git pull` command is a combination of `git fetch` and `git merge`. It fetches changes from the remote repository and automatically merges them into the current local branch.
- Pull is a convenient way to update your local branch with the changes from the remote repository in a single command. However, it may automatically create a merge commit, which can affect the commit history.

In summary, while both "fetch" and "pull" involve retrieving changes from a remote repository, "fetch" is more explicit and allows you to inspect the changes before merging, whereas "pull" automatically merges the changes into your local branch.

Best regards,
ChatGPT

### FAQ013
How do you resolve a merge conflict in Git?
Expand Down

0 comments on commit 64edc52

Please sign in to comment.