6

This is probably a basic question, but let’s say I just cloned a GitHub repo to my computer. and then someone else working on the project changes something on the Github repo. How could I update my local code to be the same as the GitHub code?

Christian
  • 4,902
  • 4
  • 24
  • 42
Elliott Weiss
  • 159
  • 1
  • 1
  • 3

1 Answers1

13

To update your local repository with remote repository you can use

git pull

else if you want to update a specific branch you can use

git pull origin <branch_name>
replace <branch_name> with your branch

The git pull command first runs git fetch which downloads content from the specified remote repository. Then a git merge is executed to merge the remote content refs and heads into a new local merge commit.

also @Jeff Bennett has answered for a similar type of question, for more information you can refer update(pull) a branch before a pull/merge request

kiran
  • 273
  • 2
  • 14