# Adding a project to a git repository

**URL:** <https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297>\
**Category:** General\
**Created:** [19 June 2023 11:09 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297 "2023-06-19T11:09:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jw\_te\_r](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jw_te_r/32/69700_2.png) [@jw\_te\_r](https://discourse.nodered.org/u/jw_te_r)\
**Post date:** [19 June 2023 11:09 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/1 "2023-06-19T11:09:23Z")

</div>

Hi all, I'm trying to put my project on github but somewhere something is going wrong.  
I created an empty repository on my github account, enabled projects in Node-Red, and added my github repo url to the Node-red project settings. Local project history works ok, nothing happens online.

In the 'commit history' menu I found a dialog behind the button with up/down arrows ('manage remote branch', quite well-hidden ), where it says there is no remote branch.  
Isn't that what I just set up via the 'settings' dialog?

Anyway, when I try to set up a remote branch there Node-red is asking for credentials, and I'm at a loss which credentials are needed. My Node-Red project password, my github password, my custom key? I tried them all, none work.

Can anybody give me a hint?

---

<div class="post-metadata">

**Author:** ![hughsheehy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hughsheehy/32/58679_2.png) [@hughsheehy](https://discourse.nodered.org/u/hughsheehy)\
**Post date:** [19 June 2023 11:52 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/2 "2023-06-19T11:52:25Z")

</div>

I have integration with github working, but have a related problem.

I'm certainly not the right person to answer the OP's question, but can perhaps add my issue.

When I get github integration working (which seems random), the next time I try to push changes to github from the interface, the connection is broken again.

Is there a guide on how to set up github integration? I've messed around and gotten it to work, but it's erratic!

This is the error I keep getting.

> _Unable to access remote repository_
> 
> _Retry_

H

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [19 June 2023 12:07 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/3 "2023-06-19T12:07:37Z")

</div>

> [@jw\_te\_r](#):
>
> Can anybody give me a hint?

You have to create a Personal Access Token in your GIT account. You then enter this token in the authorisation box in node red in the User Name field. Leave the Password field empty.

---

<div class="post-metadata">

**Author:** ![jw\_te\_r](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jw_te_r/32/69700_2.png) [@jw\_te\_r](https://discourse.nodered.org/u/jw_te_r)\
**Post date:** [19 June 2023 12:42 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/4 "2023-06-19T12:42:59Z")

</div>

Suddenly it works, thanks!  
Problem is, I'm not sure how I did it.  
In my opinion, all things Git are thoroughly confusing.  
(and it seems I'm not the [only](https://www.youtube.com/watch?v=CDeG4S-mJts) one)

---

<div class="post-metadata">

**Author:** ![hughsheehy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hughsheehy/32/58679_2.png) [@hughsheehy](https://discourse.nodered.org/u/hughsheehy)\
**Post date:** [19 June 2023 13:22 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/5 "2023-06-19T13:22:48Z")

</div>

Drat. I still get the same error.

> **Unable to access remote repository**
> 
> **Retry**

H

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [19 June 2023 13:24 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/6 "2023-06-19T13:24:50Z")

</div>

Hi, did you enable repository access when you created the token? You have to tick the boxes.

 ![Screenshot_2023-06-19_14-26-32](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/02e3ebcbf86d2404e6c98f0432d87191cd492289.png)

---

<div class="post-metadata">

**Author:** ![hughsheehy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hughsheehy/32/58679_2.png) [@hughsheehy](https://discourse.nodered.org/u/hughsheehy)\
**Post date:** [19 June 2023 13:37 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/7 "2023-06-19T13:37:34Z")

</div>

I did.

I don't get it.

But I'll look later. It's been erratic for months.

---

<div class="post-metadata">

**Author:** ![hughsheehy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hughsheehy/32/58679_2.png) [@hughsheehy](https://discourse.nodered.org/u/hughsheehy)\
**Post date:** [27 June 2023 11:28 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/8 "2023-06-27T11:28:24Z")

</div>

Right...I still can't make it work.

I put the personal access token in, no password, when that option appears.

I have the general git config set up with username and email.  
The remote is configured in Project Settings.

Is it a thing where you get one chance? When it doesn't work, i delete and then re-add the remote. Then I get another chance to log in with the personal access token. But then it still doesn't work.

Clearly, I'm doing something silly.

H

---

<div class="post-metadata">

**Author:** ![hughsheehy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hughsheehy/32/58679_2.png) [@hughsheehy](https://discourse.nodered.org/u/hughsheehy)\
**Post date:** [28 June 2023 12:31 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/9 "2023-06-28T12:31:05Z")

</div>

I think I found the answer.

The repo we've got our Node-Red code in is in a Git Organization.

In a git organization, there is a setting that allows - or does not allow - personal access tokens to access repositories in that organization. So even if your personal access token is set to access repositories, the settings in the organziation can overrule that.

See [here](https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/setting-a-personal-access-token-policy-for-your-organization).

Once I changed the setting to allow personal access tokens to have access, then it "just worked".

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 July 2023 12:31 UTC](https://discourse.nodered.org/t/adding-a-project-to-a-git-repository/79297/10 "2023-07-12T12:31:53Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
