I’m developing a personal project that wasn’t originally intended to be public (just for me, testing, fun, learning, etc.) This project has grown a bit and become serious enough that I now want to make it public and contributable on GitHub.
So I’d like to set up Git for this project, but I don’t know the right approach to take. My naive approach would be to start a new Git environment, push the whole project into the master branch and then continue to develop the project using Git as if it had been there all along. It doesn’t seem a very elegant solution to me, though.
I don’t know much about Git other than the basics, so which approach would be considered the more appropriate?
8
My naive approach would be to start a new Git environment, push the whole project into the master branch and then continue to develop the project using Git as if it had been there all along.
That seems like a perfectly good approach. If you don’t have the history of what you’ve done so far in any convenient form then you can’t get that history into Git. If you have some old versions, but not tracked as any systematic series of versions, then it’s unlikely to be worthwhile converting that series of ad-hoc versions into a Git history.
So probably the best thing is to just add all files that make up the current version of the project (excluding anything that needs to be kept secret) to a Git repository and then use Git to track changes from now on.
5
I’ve done this a couple times. What I usually do (if using Github) is create a new empty repo on Github, clone it locally, copy my code into it, and push it all up.
6
If u were doing any sort of release-management, eg a zip file, any time u made changes, u could incramentally put the contents of each into git, starting with the oldest, or if u had a regular backup of the code being made, u could restore a backup for each days work and put the contents of each into git, starting with the oldest.
David Buzz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1