0

I am new at git and github. I have a private github repository and same project at my local but It is not git repository. I don't want to clone git repository directly because I already have that project at the local machine. How can I synchronise local non git repo of same project which have github repository?

Punit Vara
  • 3,744
  • 1
  • 16
  • 30
iedmrc
  • 742
  • 2
  • 8
  • 21
  • Which version control do you use locally? If the answer is *none*, then create a Git repo and use it. – eckes Dec 01 '15 at 10:46
  • First of all git and github are different look [here](http://stackoverflow.com/questions/13321556/difference-between-git-and-github) for difference. Create a git repo in a directory with `git init` and paste your local project files in that one. Now from github copy cloning address and set that as upstream repo for locally created git repo. – Punit Vara Dec 01 '15 at 10:51
  • can you explain more about this "set that as upstream repo for locally created git repo" thank you. – iedmrc Dec 01 '15 at 17:39

1 Answers1

0

You can add the github repository as a remote (using git remote add, see here). If the local folder and the github repo are the same, a git pull should tell you that everything is up-to-date. Otherwise, it should show the changes.

Edit: Ah, it looks like your local folder is not yet a repo. For that, you will need to create a local repository first by using git init.

Alternatively, you can also checkout the github repo and simply copy your local changes on top of that.

mrks
  • 8,033
  • 1
  • 33
  • 62