This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF53: What files to add to project Git Repo

Sorry if this is a repeat ticket. I've done some searches and they result in information around Zephyr and RF Connect SDK Git repos and West usage to manages related source files and builds. But the search hasn't not yet reveled any info about what directories / files in my development environment I should be put in my project Git repo to be able to reproduce the build at a later date.

In my case, I used VSCode with the nRF Connect Extension Pack plugin and started with the peripheral UART sample created as a "workspace". So, I think my environment has all of the source files, moet cloned from versioned repos by west, and some files I am modifying or adding to the project.

So now I want to take what I have created and get it into a new project Git repo that I will manage on Github. But I don't know what directory to init my git repo, how to define my .gitignore (is there a standard nRF Connect SDK ignore file?), and what files to confirm are under source code management.

Any suggestions or pointers to info that defines how to manage my files with Git would be great.

-Brad

Parents
  • Hi Brad,

    Correct me if I'm wrong, but as far as I'm understanding you're getting started developing and want to upload a NCS-projects that you've written such as a modified peripheral_uart to to your own github repository. Also, in case you're either new or intermediary to developing with nRF Connect for Desktop in VSCode, the Nordic Academy page has a great getting started guide you might want to check out!

    So now I want to take what I have created and get it into a new project Git repo that I will manage on Github. But I don't know what directory to init my git repo,

    In general you only want your application uploaded to git and to have the SDK (nRF Connect for Desktop) and its toolchain set up locally on the computers. Doing it this way allows you to build and flash the application on your local device where you clone your github-repo to. If you're doing it this way, then I would add the build folder to the .gitignore file.

    There are multiple ways to create and work with your application, but I personally prefer to write my projects in a "my_projects"-folder on the same level as the toolchain. The application you're writing can still be created from existing samples through the nRF Connect extension and developed in VSCode.

    Where you may organize your applications according to what toolchain you're working with (1.9.1 or 1.8.0 etc), where "my_git_sample" is the sample app for demonstration purposes. This folder contains a "hello_world"-sample with an additional .gitignore.

    From here, you must have installed git on your Windows machine through a tutorial such as this step by step guide from pheonixnap.com (or other similar tutorials. This was just the first search I found). 

    So now I want to take what I have created and get it into a new project Git repo that I will manage on Github

    The first step is to create a empty git-repo on your github. 

    After this, you will be prompted from a quick-setup to either add something to the repo through bash/cmd/desktop. Choose the method suited for you based on if its a new or existing project. 

    If you choose method "existing repository", open up a git bash window to that application folder (in my case the path is C:\Nordic\SDKs\ncs\my_projects\1.9.1\my_git_sample), and write the lines from the quick setup. You might have to set up a git token or two-factor on your git to allow you to set up remotes from bash, but that should be relatively quick to set up if you have not done so already.

    how to define my .gitignore

    The .gitignore can be defined by simply creating a new file in the application folder (either from explorer or adding a new file in vscode), and naming it ".gitignore". Here you write what folders you want to ignore, such as "build/", meaning all files in the folder named build.

    I hope this gets you started, and let me know if you have any additional questions!

    Kind regards,
    Andreas

Reply
  • Hi Brad,

    Correct me if I'm wrong, but as far as I'm understanding you're getting started developing and want to upload a NCS-projects that you've written such as a modified peripheral_uart to to your own github repository. Also, in case you're either new or intermediary to developing with nRF Connect for Desktop in VSCode, the Nordic Academy page has a great getting started guide you might want to check out!

    So now I want to take what I have created and get it into a new project Git repo that I will manage on Github. But I don't know what directory to init my git repo,

    In general you only want your application uploaded to git and to have the SDK (nRF Connect for Desktop) and its toolchain set up locally on the computers. Doing it this way allows you to build and flash the application on your local device where you clone your github-repo to. If you're doing it this way, then I would add the build folder to the .gitignore file.

    There are multiple ways to create and work with your application, but I personally prefer to write my projects in a "my_projects"-folder on the same level as the toolchain. The application you're writing can still be created from existing samples through the nRF Connect extension and developed in VSCode.

    Where you may organize your applications according to what toolchain you're working with (1.9.1 or 1.8.0 etc), where "my_git_sample" is the sample app for demonstration purposes. This folder contains a "hello_world"-sample with an additional .gitignore.

    From here, you must have installed git on your Windows machine through a tutorial such as this step by step guide from pheonixnap.com (or other similar tutorials. This was just the first search I found). 

    So now I want to take what I have created and get it into a new project Git repo that I will manage on Github

    The first step is to create a empty git-repo on your github. 

    After this, you will be prompted from a quick-setup to either add something to the repo through bash/cmd/desktop. Choose the method suited for you based on if its a new or existing project. 

    If you choose method "existing repository", open up a git bash window to that application folder (in my case the path is C:\Nordic\SDKs\ncs\my_projects\1.9.1\my_git_sample), and write the lines from the quick setup. You might have to set up a git token or two-factor on your git to allow you to set up remotes from bash, but that should be relatively quick to set up if you have not done so already.

    how to define my .gitignore

    The .gitignore can be defined by simply creating a new file in the application folder (either from explorer or adding a new file in vscode), and naming it ".gitignore". Here you write what folders you want to ignore, such as "build/", meaning all files in the folder named build.

    I hope this gets you started, and let me know if you have any additional questions!

    Kind regards,
    Andreas

Children
No Data
Related