1

When downloading(not cloning) a repository via github there is no .git folder. If you make changes to this repository and then realize that you want to merge it with a real repository, what is the right way to do it?

Simon Moshenko
  • 2,028
  • 1
  • 15
  • 36
  • Possible duplicate of [How do I clone into a non-empty directory?](https://stackoverflow.com/questions/2411031/how-do-i-clone-into-a-non-empty-directory) – phd Nov 05 '18 at 12:30

1 Answers1

2

The zip you are downloading from github has a comment which is a commit-id. Find a way to extract it. When you have the sha1, you know for sure which version you had when downloaded the zip. After it, you could just get a real git-repo and have it locally. E.g. try following steps:

  1. Clone the real repo from github.
  2. do git checkout -b myZipChanges <commit-id> of the sha1 you extracted from the zip comment
  3. move .git folder into the repo snapshot you extracted from that zip.
  4. Now you'll have right state in your working directory - do whatever you like as usual.
kan
  • 28,279
  • 7
  • 71
  • 101