I often seem to get into a situation where I start sandboxing a project in one repo, and then I have to move the project to a more official one as the it matures. When this happens, I have to struggle a bit to make it work. So, therefore, this note to myself to make it easier for me the next time. Maybe you will also find it useful. Prerequisites are a git command tool. You can download it from here.

What I finally did in this case was:

  • Create the new repo.
  • Open a command line
  • Move to and create a new directory.
  • Clone the new repo into the new directory like this: git clone "new repository url"
  • Then copy the code files from the old directory (and only the code files, not the .git directory) to the new directory.
  • Then run git add .
  • And then git commit -m "initial commit".
  • and finally git push --all

That’s it!

Last modified: December 9, 2020

Author

Comments

Write a Reply or Comment

Your email address will not be published.