What is the difference between git pull and git fetch?
a)
git pull fetches and merges changes, while git fetch only downloads changesb)
git fetch deletes remote changes, while git pull updates your repositoryc)
git fetch resets the repository, while git pull clones a new repositoryd) Both commands do the same thing
Answer:
a)
git pull fetches and merges changes, while git fetch only downloads changesExplanation:
The difference between git pull and git fetch is that git pull fetches changes from a remote repository and merges them into your local branch, while git fetch only downloads the changes without merging them.
After fetching changes, you can manually merge them into your local branch. Pulling automatically merges the changes, saving you a step.
Knowing when to use each command helps you control the update process and avoid unintended merges.