Ralph J. Smit Laravel Software Engineer
GitHub is a great tool for collaborating with your team and sharing open-source projects. GitHub now also offers an option to start a new project, based on another project. GitHub calls this 'template' repositories.
Template repositories are a nice way to start a new project with a certain set of files. However, there's one downside: you will always see the message 'generated from template/repository'.
It is possible that you don't want this message to be visible on your repository forever. There's not an official way to get rid of it, but luckily there's a nice and easy workaround.
Hiding the 'Generated From' message on GitHub
Before going on, you should be know the following: you will lose all stars, issues, pull requests, etc. So only do this if the repository is still in its initial state or if you absolutely don't care. You will not lose the commit history, only the GitHub-specific things.
So, how do we do this? The process looks like this:
Clone all the code to your local environment.
Delete the repository on GitHub.
Create a new repository on GitHub with the same name.
Push the code from your local environment to GitHub.
Cloning all the code to your local environment
First, you need to clone the code to your local environment. You can do so by running the following command:
git clone email@example.com:ralphjsmit/awesome-code.git
Replace the repository name with your own repository.
Deleting the repository on GitHub
Next, you should delete the repository on GitHub. You can go to Settings > General > Delete this repository.
Creating a new repository with the same new
Now, you should create a new repository on GitHub with the same name as the previous repository. Go to github.com/new and create a new empty repository.
Pushing the code back to GitHub
Finally, go back to your local environment. Now we should push the code to GitHub again. Run the following command:
git push origin
Now, you can go to GitHub again and you should see the empty repository filled again with all your code and your commit history!
As you've seen, removing the 'generated from' message from GitHub is not supported by GitHub, but doing it yourself is not difficult. The downside is that you'll lose your stars, issues etc. So if you have a plain repository, this will method will be great. If not, just hope that GitHub will add this function in the future 😁
Published by Ralph J. Smit on in Github. Last updated on 21 March 2022.
Like what you read?
Get notified when I publish something new, and unsubscribe at any time.