How to pull and push the code to the remote repositories.

How to pull and push the code to the remote repositories.

  • git pull

git fetch

Git fetch command is used to fetch the remote changes from one or more remote repositories or tags, to complete their history.

$ git fetch <remote>
$ git fetch <remote>  <branch>

git pull

The git pull works exactly like the git fetch it first pulls down all the changes from the repositories to the local repo, but the only difference is that it merges all remote changes to the local commits after pulling the changes.

$ git pull <remote> <branch>

git push

The git push command pushes all the local refs to the remote refs, it will basically push all of your local changes to the remote references. The syntax is pretty simple,

git push <remote> <branch>

--

--

Hey ๐Ÿ‘‹, I am Adarsh, a Web Developer from ๐Ÿ‡ฎ๐Ÿ‡ณ

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adarsh Thakur

Hey ๐Ÿ‘‹, I am Adarsh, a Web Developer from ๐Ÿ‡ฎ๐Ÿ‡ณ