Reputation: 1344
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
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
Reputation: 144
In current GitHub nomenclature 'master' was replaced with 'main'.
So, the command to use is:
git pull origin main
Upvotes: 7
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
Reputation: 185540
If you want to fetch + merge, run
git pull
if you want simply to fetch :
git fetch
Upvotes: 130