What is the difference between pull and clone in git?

619    Asked by DianaCampbell in Devops , Asked on Jul 25, 2023

description: What is the point of difference between doing (after mkdir repo and cd repo):

Git init
Git remote add origin git : //github.com/chandra/repo.git
Git fetch - - all
Git pull origin master

And 

Git clone git ://github.com/chandra/repo.git
Are both performing the same thing?
Answered by Diane Carr

Git clone refers to the way to receive a local copy of the current repository to perform the task. Git pull is the amalgamation of git fetch and git merge. Git pull refers to the way of upgrading the local copy with fresh commits from the remote repository.


Git clone is deployed for only downloading appropriately what is recently performing on the remote server repository, and saving it in the machine’s folder where the project is positioned. It is utilized mostly while we require to upload the project for the very first time. After using the git clone, pull is the appropriate option. Now moving on to git pull, the git pull command is meant to find and download content from a remote repository and instantly upgrade the local repository to comply that content. ALigning remote upstream modifications into the local repository is an ordinary work in git-based cooperative workflows.

Git pull refre to a clone download and merge operation and primarily utilized while we are performing as a united team. When we wish that the latest changes are needed to be done to the project, you may pull. The clone will create extra remote-tracking branches. The devOps certification training provides extensive training form the comfort of your place to make you job-ready to face the market and offer a tough blow to the competitors. Offering knowledge on the various devOps chapters and also giving hands-on experience, you can become an expert to face the job market.



Your Answer

Interviews

Parent Categories