How to fork a repository multiple times on Github?

Viewed 59

I use the tool from Raspberry Pi to create images of the Raspbian OS (https://github.com/RPi-Distro/pi-gen).

My workflow is to fork their repository and then start building my project on top of the OS. It comes handy in order to burn the final project on a SD card for the hardware.

My problem comes when I have a second project, and I try to create a second fork of the original tool in my Github repository. Github just redirects me to my first project, which is a fork of the tool. But I don't want to work on my first project, no even creating a different branch as the second project is different, not a different version of the first project, just a project on its own.

I use the Raspberry Pi tool a bit like a framework to build projects (and I believe that's the way it is intended). Like you would find in web development with Django, Rails... That would make no sense to me to install the framework once and then create branches for the different projects I create with it.

What would be a sensible approach here?

1 Answers

A fork makes sense if you intent to contribute back to the original repository, through pull request.

In your case, I would recommend the following process, which you can replicate as many time as you need:

  • make a new repository on GitHub, for your next projet
  • git clone locally https://github.com/RPi-Distro/pi-gen
  • rename the root folder
  • inside, change the origin to the one for your new project
  • push

That is:

 git clone https://github.com/RPi-Distro/pi-gen
 mv pi-gen myNewProject
 cd myNewProject
 git remote set-url origin https://github.com/me/myNewProject
 git push -u origin master:main
Related