0

I have a master project stored on my development machine. I push this to Github when changes are made.

But, I made 2 changes directly on Github as they were only modifications to the README and I was on a different computer.

My local is now different to the remote (the Github repo).

How do I get the local back in sync? The local was the main copy, but I think it's better to have the Github repo as the master.

BugHunterUK
  • 8,346
  • 16
  • 65
  • 121
  • 1
    Possible duplicate of [Updating a local repository with changes from a Github repository](http://stackoverflow.com/questions/1443210/updating-a-local-repository-with-changes-from-a-github-repository) – codingbadger Aug 15 '16 at 15:24

1 Answers1

2

You should run a git pull origin main and merge with your local.

When done merging do git push origin main to sync up the remote

If your local changes are too large you can use git stash to hide them temporarily and pop them out of the stash (git stash pop).


EDIT: October 2020: Github changed master to main. For older git repos please use master instead of main in above commands

cjds
  • 8,268
  • 10
  • 49
  • 84