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

**URL:** <https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668>\
**Category:** General\
**Created:** [24 July 2019 20:33 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668 "2019-07-24T20:33:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![rando](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@rando](https://discourse.nodered.org/u/rando)\
**Post date:** [24 July 2019 20:33 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/1 "2019-07-24T20:33:58Z")

</div>

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?

Thanks!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [24 July 2019 20:47 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/2 "2019-07-24T20:47:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rando](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@rando](https://discourse.nodered.org/u/rando)\
**Post date:** [24 July 2019 20:50 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/3 "2019-07-24T20:50:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [24 July 2019 20:51 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/4 "2019-07-24T20:51:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [24 July 2019 20:52 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/5 "2019-07-24T20:52:06Z")

</div>

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](https://kbroman.org/github_tutorial/pages/init.html) for info.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [24 July 2019 21:05 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/6 "2019-07-24T21:05:27Z")

</div>

If you are using node-RED 'projects', you could alternatively;  
Delete the `.git` folder as above, [and use 'projects'](https://nodered.org/docs/user-guide/projects/) to convert it to a new project.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [24 July 2019 21:08 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/7 "2019-07-24T21:08:02Z")

</div>

> [@Paul-Reed](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [25 July 2019 08:29 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/8 "2019-07-25T08:29:04Z")

</div>

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.

```auto
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?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [25 July 2019 13:04 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/9 "2019-07-25T13:04:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rando](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@rando](https://discourse.nodered.org/u/rando)\
**Post date:** [25 July 2019 14:15 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/10 "2019-07-25T14:15:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [26 July 2019 18:54 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/11 "2019-07-26T18:54:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 November 2020 22:32 UTC](https://discourse.nodered.org/t/after-pulling-an-existing-node-red-github-project-is-it-possible-to-push-the-modified-code-into-its-own-new-repository/13668/13 "2020-11-13T22:32:01Z")

</div>


