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?
Asked
Active
Viewed 2.8k times
6
-
https://stackoverflow.com/search?q=%5Bgit%5D+update+local+repository – phd Dec 30 '20 at 10:07
1 Answers
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