Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sync with a remote Git repository?

I forked a project on github, made some changes, so far so good.

In the meantime, the repository I forked from changed and I would like to get those changes into my repository. How do I do that ?

like image 460
George Profenza Avatar asked Nov 30 '10 11:11

George Profenza


People also ask

Is there a git sync command?

git-sync is a simple command that pulls a git repository into a local directory. It is a perfect "sidecar" container in Kubernetes - it can periodically pull files down from a repository so that an application can consume them. git-sync can pull one time, or on a regular interval.


2 Answers

Generally git pull is enough, but I'm not sure what layout you have chosen (or has github chosen for you).

like image 70
Šimon Tóth Avatar answered Sep 22 '22 15:09

Šimon Tóth


Assuming their updates are on master, and you are on the branch you want to merge the changes into.

git remote add origin https://github.com/<github-username>/<repo-name>.git git pull origin master 

Also note that you will then want to push the merge back to your copy of the repository:

git push origin master 
like image 32
Mark Hibberd Avatar answered Sep 26 '22 15:09

Mark Hibberd