After pulling an existing node-red github project, is it possible to push the modified code into its own new repository?

I have a node-red project that is hosted on git hub that I pulled onto my Raspberry Pi. I made a lot of modifications and it has become its own separate project. I want to push the new project to its own repository while leaving the original project in its original state in its current repository. Is there an easy way to do this? What configuration files would I have to modify?


Are you using the built in node-red projects feature, or DIY with git?

I have been using (and loving) the built-in projects feature, but anything that will achieve what I'm trying to do is fine with me.

I could tell you how to do it if you were not using the projects, but I don't know enough about how the projects feature works so will have to let someone else answer.

If you look in the 'new project' folder you'll see the .git folder containing all the information that links the local & remote repo together;
If you delete that .git folder you will remove the link to the original repo.
Then initialise the 'new project' folder as a git repo, and push it to the remote as a new project.
See this article for info.

If you are using node-RED 'projects', you could alternatively;
Delete the .git folder as above, and use 'projects' to convert it to a new project.

You do not need to do any of this. You can do it all via the editor UI.

  1. Create a new GitHub repository. Do not initialise it with any files.
  2. In Node-RED, open the project settings. Delete the existing 'origin' remote and add the git URL of your new repo as a new remote.

Now when you push commits, they will go to the new repo.

1 Like

I think that you need to change the "origin" - but I am far from an expert so I'd test this on something that isn't critical.

remote add origin <your new gitlab repo address>
git push -u origin --all
git push -u origin --tags

I assume that you also have to remove the old origin?

I've already explained how to change the origin using the Node-RED UI. No need to add another response that you aren't sure about.

Awesome, thanks for the info knolleary! I will give this a shot today.

Actually, I started writing that when there were no other replies. I imaging that your later reply was hidden behind the editor when I hit the reply button later in the day. I didn't check.