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