Publishing nRF project from VSCode to GitHub

Hello


I am trying to move all my Nordic project development into VSCode, and also link this with GitHub.
Following examples on line, I installed the GitHub Pull Requests and Issues extension, and I have signed in to GitHub from VSCode, so that now I have the extra GitHub icon in the left-most bar in the IDE.


To publish a project from my local PC to GitHub for the first time, I came across various examples that say:
- Open the project in question (in this case, a modified version of the Peripheral UART for the nRF5340 DK)
- Click in the Source Control Management (SCM) icon, and I will see a button that says Publish to GitHub:



However, this is not what I see, regardless of which project I open - I see the following, with no option to publish anything to GitHub:



I assume I have missed a step along the way.

Parents
  • Hi Garrett,

    When using Git with a new project, the first thing to do it is to initialize a repository. This can be done in the command line with git init, or in VS Code through the command palette: Ctrl+shift+p --> Git: Initialize Repository

    This creates a .git folder in your working directory, which VS Code will recognise and display in the source control tab you were looking at earlier:

    You can then start adding files and committing changes. To upload your project to a remote repository such as GitHub, you can follow one of many guides online.

    The reason your source control tab didn't look like your first screenshot is because the NCS codebase itself is managed by source control too, and the nRF Connect for VS Code extension displays this in the "West" section.

    As you might know, Zephyr has a "swiss-army knife" tool called West, which among other things has source control features. These features, controlled by a West manifest, are useful for managing projects that depend on multiple Git repositories, but are not needed for normal application development. Feel free to ignore and collapse that section (as I've done above).

    Best regards,

    Raoul Pathak

  • Hi Raoul,

     

    Thank you for your reply.

    I got 99% of the way there… Blush

     

    I tried the method you suggested.

    Before using the [ Ctrl+shift+p --> Git: Initialize ] command, I added a .gitignore file to the project folder with the following contents:

    • build/
    • build-*/
    • build_*/

    VS Code did create the repository, and all the uncommitted project files (excluding the build files) were then visible in VS Code under the Source Control section.

    All good so far.

    Adding a Nordic VS Code project to GitHub

    After committing these files (from within VS Code), the “Publish Branch” button was displayed.

    Clicking this initiated a sequence of events authorising GitHub access to the project etc., and the project was then published in GitHub.

    The only thing I didn’t see how to do was how to choose which organization within my GitHub account that I wanted to publish the repository to, but I will figure this out the next time

Reply
  • Hi Raoul,

     

    Thank you for your reply.

    I got 99% of the way there… Blush

     

    I tried the method you suggested.

    Before using the [ Ctrl+shift+p --> Git: Initialize ] command, I added a .gitignore file to the project folder with the following contents:

    • build/
    • build-*/
    • build_*/

    VS Code did create the repository, and all the uncommitted project files (excluding the build files) were then visible in VS Code under the Source Control section.

    All good so far.

    Adding a Nordic VS Code project to GitHub

    After committing these files (from within VS Code), the “Publish Branch” button was displayed.

    Clicking this initiated a sequence of events authorising GitHub access to the project etc., and the project was then published in GitHub.

    The only thing I didn’t see how to do was how to choose which organization within my GitHub account that I wanted to publish the repository to, but I will figure this out the next time

Children
No Data
Related