Lesson 1 Exercise 2 Git Issues

I followed all the steps from exercise 1 and 2 (lesson 1) up to step 3.3. When I try to create the application, I get this error instead of any options as shown in the course:

[14:45:55] nRF Command Line Tools 10.23.0 are up to date
Command failed: git commit -m "Initial commit for blinky"
Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'Robert@LAPTOP-1IRSBTHE.(none)')

This is my first time using Visual Studio Code or any Nordic devices ever, and I have no clue what I did wrong- git was never mentioned in any of the previous steps in the course.

Thanks

  • I assume the lesson and exercises you are talking about are related to the Nordic Developer Academy.
    Not sure why or how they teach version control in these courses but this issue seems soley related to git.

    As the output reads it wants you to identify yourself, so it can mark you as the author of the commit. This is just how git is supposed to work.
    I enccourage you to read more about this vcs in the link above, if you are interested. Although i am not aware if it is actually necessary
    to learn this tool for completing the courses, since i never did them myself.

    If you just want to continue with the course and can not be bothered to learn another tool at this point in time,
    simply follow the instructions displayed an globally configure a git user.

    git config --global user.email "[email protected]"
    git config --global user.name "robertz"
    
    // Then you can perform your commit
    
    git commit -m "Initial commit for blinky"


    Git will use these credentials to mark the commits you perform as done by this user.

    Hope this may help you.

  • Hello,

    There's nothing you did wrong. What's happening is that our VS Code extension attempts to set up a local Git repository for your project to enable version control but fails because Git hasn't been configured on your PC. This should be an optional step, but currently, it isn't because the extension fails to complete the project creation when Git reports this error. This will be addressed in the next release. 

    For now, you will have to register a git profile on your PC. To do this, open you can open a terminal in VS code as shown in the screenshot below, then run the git config --global user.email  and git config --global user.name command as instructed in the error message you received.

    Best regards,

    Vidar

  • I did not see your answer before posting mine. Thanks for answering.

  • Thank you for this good instruction. I'm a new user to Visual Studio Code with NRF. My first impression is that this is quite shitty.

    So far I've encountered the issue above. Then it complained that git wasn't installed at all. It's not clear why I would need to install git; our company uses a different VCS. I'm trying to just blink an LED on the nrf52840-DK but this is not very user friendly. So I started with the example blinky. Now it won't build unless I create a build configuration. Ok I figured out how to do that. but it sure takes awhile for some reason.

    Now flashing failed due to readback protection on this device. Ok solved that issue. But we're not done yet; when attempting to build I got an error that "the --family option given with the command does not match the device connected. *sigh* This process really feels like the product wasn't fully tested prior to release. I usually don't encounter so many issues getting a development up and running. I will open up another thread for this issue.

  • I'm sorry to hear that you encountered so many problems with getting up and running. Git is a prerequisite for downloading the SDK since the SDK and all of its modules are hosted on GitHub. This is why Git is bundled with the toolchain, so you don't have to install it separately.

    Once the SDK is installed, you are free to use any VCS with your project, see "Avoid Git and West".

    Xology said:
    Now flashing failed due to readback protection on this device. Ok solved that issue. But we're not done yet; when attempting to build I got an error that "the --family option given with the command does not match the device connected. *sigh* This process really feels like the product wasn't fully tested prior to release. I usually don't encounter so many issues getting a development up and running. I will open up another thread for this issue.

    I'm not sure why you're receiving this error after readback protection has been disabled. It would be helpful if you could try programming the same hex using the Programmer app in nRF Connect for Desktop (link).

Related