So long story short, a while ago I forked a Jekyll template to learn how to use the framework. I have made MANY changes to the original starting point and have completely refactored the code to be my own.
The problem is that the repository on Github is still listed as a Fork of the old template, which prevents me from creating Issues to track todos, bugs, ect. I would ideally like to take all the code I have written and copy it to a new repository and continue developing in that environment instead of the fork.
My question is in the actual mechanics of copying the project. Do I simply copy the entire project folder to a new folder, rename it, and then git init
to start a new repo? Should I not copy the .git
folder or any other specific folder? Is there a command line command for git or jekyll that may simplify this?
Here are the directories and files in the project:
.bundle/
.git/
.gitignore
.jekyll-cache/
.sass-cache/
_config.yml
_data/
_drafts/
_includes/
_layouts/
_posts/
_sass/
_site/
404.md
about.html
CNAME
Gemfile
Gemfile.lock
homepage.html
images/
index.html
js/
LICENSE
README.md
style.scss
vendor/
Edit: I didn't specify, but keeping the git history is not terrible important to me (espcially from before I forked).
I also am curious if bundler would still work without any extra steps, i.e. could I just run bundle exec jekyll serve
still without any new setup?
I want to answer with how I got the copied project to work, just in case someone is looking to do so with their project in the future. Thanks to @PSGuy for the general idea of how to get it done.
My goals for this were to:
I did not need to:
With all that in mind I started by making a copy of the whole folder using the command:
cp -r oldRepo/ newRepo/
I then went into the new directory and started a local server for the project to make sure nothing was broken out of the box. After that was fine I removed all the previous git info for the project by running:
rm -rf .git/
I then made a few minor documentation tweaks and added an MIT license for the project. With everything in place I made a new empty repo on Github and copied the remote URL (something like https://github.com/usrName/myProject.git
). From the command line in the new directory I then simply initialized a new git repo, added the remote to github, created a new commit, and pushed to the remote.
git init
git remote add origin https://github.com/usrName/myProject.git
git add .
git commit -m "initial commit"
git push origin master
From there everything is working as intended and I can develop further from here.
One thing to note is that when you copy the folder, it is making a copy of whatever branch you have checked out at that time by default. By then deleting .git/
you are getting rid of any project history so be sure this is what you want! That branch you copied will then become Master
in the new project and there will be no other branches preserved if you follow this method.