This project serves as a common root, or initial commit, for all future projects that I start.
The problem that this git
repo seeks to solve is that of no common root to repos.
When you have no common root, you cannot merge two repositories,
and this has been an issue for me in the past
when I realized that two projects were more related than previously thought
or I otherwise wanted to combine two previously unrelated projects.
The solution is a repository such as this, which contains the common root for all future projects.
I do not recommend using this common root because it will have me as the contributor. Instead:
- Create your own
git
common root project. - Then, I recommend giving it an empty commit.
The message should describe that this is the first commit of the project.
I named mine "started project", which is not the most ideal name, but I didn't know that it would be used for this at the time, and it has hence been repurposed. Also, I don't recommend referring to the branch because any commit can be copied to another branch in the future.
git commit --allow-empty -m "initial commit"
- Proceed with more commits for the common root as you would. However the reason I recommend an empty commit is because it's very unlikely that there will be any templating content that will be a useful initial for every single project you create. However, if you do, please feel free to use it.
- Tag the root to make it easy to which to return.
git tag -m "the common root" ROOT
- Make a second commit with an explanatory message such as this one, and
- go ahead and push to the
master
branch, but also push the ROOT tag.git push origin ROOT
When starting a new project, you can then
- Clone your own
git
common root.git clone <url to your common root remote.git> <new project directory>
- Change the remote to your new repository.
cd <new project directory> git remote set-url origin <url to your new project remote.git>
- Reset to the root.
git reset --hard ROOT
From there you could continue as normal.
Now this refers to this project. However originally "my the project" referred to a JavaScript Mad Libs laboratory assignment that I did completed in college. This was my earlier project that I could find since I found out that you can create empty commits.