Git Fetch command
Git fetch command works on the local repository where it only fetches the data from the remote repository to have a look what all the changes has been done by the developers or what all new commits are made by them.
So that it updates the developer to work.
But, it doesn’t makes a copy of the work instead it allows the developer to view the work for his acknowledge.
Git Pull command
Git Pull command works on the local repository where it makes a copy of the remote repository into your local repository.
So that it can edit or works on the work for the updating.
It makes a copy of the work and allows the developer to contribute to the work for the better actions.
Uses of the commands
The term pull is used to receive data from GitHub. It fetches and merges changes from the remote server to your working directory. The git pull is used to pull a repository.
The term git fetch is used to just fetch the data from remote repository without accessing the repository just to make a mirror for view.
Implementation and Working
Working of fetch command with multiple option:
To fetch from the remote repository:
$ git fetch< repository URL>
To fetch a specific branch:
$ git fetch <branch URL><branch name>
To fetch all branch :
$ git fetch -all
To synchronize the local repository :
$ git fetch origin
Working of pull command with multiple options as:
To pull the repository by:
$ git pull <options><remote>/<branch-name>
Areas to use
Git fetch can be use where we only have to look what the developers updated in the remote repository.
Git Pull can be use where we want to contribute in the work by cloning and using the project.