Azure data studio vs vscode1/30/2024 I like to work with each repository in a different VS Code or ADS window. Once this completes, I'll get a message asking if I want to add this folder to my workspace or open in a new window. This will make a folder under Git, at the same level as SQL Code, and put the repo there. Once I have git selected, I'll click "Select Repository Location". I'll navigate to the git folder under Documents and then select that. Once I do this, I need to pick a location on my machine to store the repo. When we select this, we need to enter a repository URL. This time we'll open the command palette (CTRL+Shift+P) and type Git again. Copy that URL to your clipboard and then go back to VS Code. The URL is: Īnyone can clone this or fork the repo if they want. ![]() I have a git repo for my basic version control talk. How do I get that onto my machine and work with it? It's easy, and let's do that now. Let's say that someone gives you a git URL and says there is code here. The same shortcuts and process from ADS works in VS Code. I've covered those in Azure Data Studio and Version Control, so read that article. Once we do, the VCS tab will show a changed file with a one next to the icon in the side menu bar.įrom here you can start to use the VCS features in VS Code. From here, we can create a new file and save it. The folder doesn't change, though two hidden items are added. If I select this, then that folder becomes a git repo. I get a list of open folders, or I can choose one. I see these options, the fourth one of which is to initialize the repository. This will open and I'll start typing "git". To do that, I'll click CTRL+Shift+P for the command palette. Instead, let's initialize a git repository. I can create a new folder or file here with these icons. If I hover over it, I see a few icons next to the name. Once this is done, the SQLCode folder appears as a section in the Explorer blade of VS Code. Since this is my folder, I'll click that I trust the authors. VS Code wants to be sure we are working with trusted code, so I'll get a message to verify that. Once I enter this name, I'll leave this folder highlighted and click the "Select Folder" button in the dialog. I'll repeat this process and create a "SQL Code" folder. ![]() I will click the "New folder" button near the top and create a "git" folder.Īfter I create this, I'll double click it. This opens me an Explorer window to pick a folder. For this, I'm using a new VM, and there isn't much in Documents. You could put a repo anywhere, but since I sometimes delete them or download them later, I want to keep them together. This let's me organize repos and always know where they are. I usually create a "git" folder under Documents on Windows. We'll start with our own code and then look at using someone else's code. When we open VS Code, we see something similar to this:įrom here I can open a file, a folder, or clone. Let's open VS Code and create a repository in which we can store files. You don't have a location to store code, but you want to get started. A New Folder and Repository in VS Codeįor this section, let's assume you've only installed VS Code and Git. These two platforms work the same, so the techniques work in either one. I'll use VS Code for one and ADS for the other. I'll tackle showing how to build a repository in two ways. ![]() Note: I would just click next for most of the install options in Windows, with the exception of changing the default branch to main instead of master. Once you've done this, then you can move forward. The install is fairly simple, and for Windows, there is an installer that sets up your system. There are downloads and installs for all major platforms, so you can pick the one that works with your platform (Windows, MacOS, Linux). While VS Code works with Git (and other version control systems), VS Code does not include the Git code. If you don't, when you go to the source control tab, you will see this message: Install GitĪpart from installing VS Code or ADS, you need to install Git. There are a couple of steps, but the process is easy and we will walk through it below. This article will show how you can work within the GUI of Azure Data Studio (ADS) or Visual Studio Code (VS Code) to save and version code without ever worrying about the git command line. In this case, how would one get started with version control? Someone commented that their co-workers didn't want to use the command line at all, but they didn't have a Git repo. I wrote an article recently on Azure Data Studio and Version Control.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |