In my previous posts I wrote about how to prepare a developer station with a Raspverry Pi 4. I wrote on how to install Visual Studio Code, how to install .Net Core and how to build and run C# projects. Of course, the next step is to work with Git.
The command to install git is
sudo apt-get install git
However, I already have Git installed. I haven’t checked, but it seems to me that the latest Raspbian distro includes by default git. I was hoping that VSCode will recognize and use this, but in order to work with Git in VSCode I need some extra work in the IDE settings.
I was able to clone some repositories from GitHub and Azure DevOps, directly from bach
So, let’s fix Visual Studio Code and Git integration. This one is very easy, I just need to go to Settings, search for Git and define the Git path for VSCode.
In order to find the git path, we need to use the [which] command
pi@rpidev3:~ $ which git
My got location is [/usr/bin/git].
I’m not a command line dude! I like User Interfaces, so now it’s time to open one of the cloned repositories in Visual Studio Code. I can see that VSCode recognices Git and I can start to commit my files.
This is also a perfect moment to define Git user name and user email.
git config --global user.email "firstname.lastname@example.org"
git config --global user.name "your name"
I like to do this in the Terminal in VSCode, just to check all is working fine.
Greetings @ Burlington
- El Bruno, How to install .Net Core in a Raspberry Pi 4 and test with HelloWorld https://elbruno.com/2019/08/27/raspberrypi-how-to-install-dotnetcore-in-a-raspberrypi4-and-test-with-helloworld-of-course/
- El Bruno, Installing Visual Studio Code in a Raspberry Pi https://elbruno.com/2019/08/20/vscode-installing-visual-studio-code-in-a-raspberrypi-a-couple-of-lessons-learned-code/
- El Bruno, Build and Run C# ,NetCore projects in a Raspberry Pi 4 with Visual Studio Code https://elbruno.com/2019/08/28/vscode-build-and-run-c-dotnetcore-projects-in-raspberrypi/