git pull or fetch difference 1

git pull or fetch difference

git fetch is the command that tells your local git to retrieve the latest meta-data info from the original (yet doesn’t do any file transferring. It’s more like just checking to see if there are any changes available).

git pull on the other hand does that AND brings (copy) those changes from the remote repository.

Here is what the above code is Doing:
1. git remote add origin https://github.com/user/repo.git
– Sets the new remote
– git remote -v shows the new remote URL
2. git remote set-url origin https://github.com/user/repo2.git
– Changes the remote’s URL
3. git remote rm origin
– Deletes the remote

Similar Posts