user2277550
user2277550

Reputation: 621

How to sync a repository with github?

I cloned a repository from GITHUB onto my local machine. And then I made a few direct commits to the GITHUB copy itself. Now I want to sync my local copy with the remote one. How should I proceed?

Upvotes: 2

Views: 53

Answers (1)

maggick
maggick

Reputation: 1422

To get the code from the remote repository:

git pull origin master

To send code to the remote repository:

git push origin master

In both commands:

  • origin is the remote (git remote -v)
  • master is the remote branch to get/send code of/to

You may get some divergences between the local and the remote code. Putting back the code back together is called a merge, sometimes it is done automatically (as often as possible) sometimes you will need to do it manually but this is another problem.

Upvotes: 1

Related Questions