Josh Randall
Josh Randall

Reputation: 1344

How to update Git clone on local system?

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.

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?

Upvotes: 82

Views: 284369

Answers (5)

Sydalmighty
Sydalmighty

Reputation: 251

git pull origin master

This will update your local copy of master with the changes from the remote repo. If new branches were pushed to the remote repo, it will also update your clone copy.

Upvotes: 19

Pedro Tavares
Pedro Tavares

Reputation: 144

In current GitHub nomenclature 'master' was replaced with 'main'.

So, the command to use is:

git pull origin main

Upvotes: 7

DHARMIK  GANGANI
DHARMIK GANGANI

Reputation: 1

If you want to change or update in your clone repository, then you simply have to write git pull origin main

Upvotes: -1

Dave
Dave

Reputation: 2150

In Android Studio its VCS then Pull then Master

Upvotes: 1

Gilles Quénot
Gilles Quénot

Reputation: 185540

If you want to fetch + merge, run

git pull

if you want simply to fetch :

git fetch

Upvotes: 130

Related Questions