Monday, March 09, 2020

Using git from within VS Code


Okay, I know I am behind the times. But I finally got around to exploring what an IDE can actually do beyond just being a fancy text editor. After all, the "I" in IDE is for integrated, so an IDE actually has a lot of integrated functions to help make life easier for programmers.

I have been using GitHub for a while, and had to try and figure out git during this time. First, most of the stuff was via the command line, which can be quite tedious. Recently, I discovered GitHub Desktop, which helps to make life easier since it is a GUI for all those command line stuff. But now, I realized that VS Code actually has all these functions built into it in the first place. I don't really need GitHub Desktop. Or git-cola.

The source control panel in VS Code really makes life so much easier for me, since most of my actions would be staging, committing, and pushing on my own repositories.

As for compiling Marlin firmware, it makes life easier for me too, since I can easily discard previous changes to the configuration files. Then pull the latest version off GitHub. And with the Meld Diff extension, I can then select to compare the new configuration files with the set that I keep in another directory, and the extension will then call up Meld for me to merge the old and new configuration files.

For pull requests to Marlin, VS Code's source control also allows me to create a new feature branch, add my changes, then push that feature branch to my Marlin fork. I can then go online to send that PR. (The GitHub Pull Requests extension even allows PRs to be submitted from within VS Code.)

Going forward, I will try to use VS Code as much as I can in my new workflow.

No comments: