How to Update Git Clone

I have started using Git. I have cloned the repo on my local system. I make the changes on the local machine and use git push to the update the remote repo. It works fine.

I have a quick query how to update my clone from the remote. I tried git remote update. It did not work, new changes does not appear. I just want to make sure I have recent copy of the repo before I get to work. How I can update the clone?

4 Answers

If you want to fetch + merge, run

git pull

if you want simply to fetch :

git fetch
2
git pull origin master

this will sync your master to the central repo and if new branches are pushed to the central repo it will also update your clone copy.

4

In current GitHub nomenclature 'master' was replaced with 'main', so the command to use is git pull origin main

1

In Android Studio its VCS then Pull then Master

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest