Git Fetch command

The Git FETCH command, which works in the local repository, only gets data from the remote repository to see all the changes or new commits made by the developer.

So it can update the developer’s work.

However, it does not copy the work, but allows the developer to see the work he acknowledges.

The Git Pull command

The Git Pull command works in your local repository. It copies the remote repository to your local repository.

Then it can edit or update the work.

It makes a copy of the work, allowing developers to contribute better to the work.

Purpose of the command

Pull is used to receive data from GitHub. It retrieves the changes from a remote server and merges them into your working directory. Gitpull is used to pull a warehouse.

The graph is pulling

The term gitFETCH is used to fetch data from a remote repository without needing to access the repository, just making a mirror for viewing.

Figure. To obtain

Implementation and Work

How the FETCH command with multiple options works.

Grammar:

Obtain it from the remote resource library.

$ git fetch< repository URL>  
Copy the code

Figure 1.1

Gets a specific branch.

$ git fetch <branch URL><branch name>  
Copy the code

Figure 1.21.2

Get all branches.

$ git fetch -all
Copy the code

FIG. 1-1. 3

Synchronize the local repository.

$ git fetch origin
Copy the code

Graph: 1.4

The pull command works in the same way as multiple options.

Syntax.

Pull the repository in the following ways.

$ git pull <options><remote>/<branch-name>  
Copy the code

Graph: 2.1

Domain of use

Git Fetch can be used when we just need to see what the developer has updated in the remote repository.

Git Pull can be used where we want to contribute to our work by cloning and using projects.

reference

www.javatpoint.com/git-fetch

www.javatpoint.com/git-pull

www.atlassian.com/git/tutoria…

Git-scm.com/docs/git-pu…