TOP 6 GIT Extensions You Need In VS Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back everyone if you're new here my name is brian jenks and today i'm telling you about my favorite git extensions in vs code vs code is an awesome code ide that is both open source and built on electron so it runs pretty much on anything anywhere and you can even use it in the cloud using github code spaces it is a very versatile editor and there are a myriad of extensions that you can use with it and git is already hard enough but these extensions make it a joy to use so we're going to get into that today [Music] i've talked about git on my channel several times before i've made these videos about it such as setting up an automated workflow and just a comprehensive overview of how to use git and some of the get workflow branching strategies really useful information there if you want to check those out timestamps will also be in the description below but git is really it's really difficult to use but frankly i remember when i was first learning it i actually learned it from somebody at a free code camp meetup it's an intimidating tool because at first you're using it on the command line which is a great way to use and learn it but there's a lot of complexity that kind of just drowns out the actual functionality you might want to get out of git because like 80 to 90 percent of what you're going to use is a very small amount of commands and a lot of these visual and graphical tools make it really easy to fix things instead of having to dig through the command line out of frustration so we're going to look at some of the best and some of my favorite get extensions that you can use in vs code to make using git version control a breeze the best ways to support the channel are if you're going to do it on an ongoing basis github sponsors because they take no fees followed by patreon if you're going to do like a one-time thing buy me a coffee paypal are just fine and if you just want to support me without any money involved the best thing you can do is like comment subscribe share the video and that's it like i already said i talked about get a lot it's a version control system that was made by linus torvalds the creator of the linux kernel and it's pretty much the industry standard of version control today it's been around for decades and it allows for a distributed collaborative network of developers to work on the same code base completely unaware of what anyone else is working on and then manage you know conflicts when they're starting to merge their code into whatever branch or centralized location that they're trying to merge it into but to keep it simple git is great for not only single person projects or collaborative team projects or something as massive as the linux kernel which is why it was invented is to make managing that code base across a distributed network of developers easier so using git was made by a kernel developer so it's probably not got the best you know ui ux and that's probably one of its shortcomings but everyone else and other developers have made great extensions to make it really easy to actually use this tool but in a graphical way because face it we are like visual creatures we get a lot of information from visual stimuli and sometimes just a text-based interface doesn't cut it so there's a great amount of extensions that just make get incredibly easy to use once you understand the logic of what's happening which is why a little bit of command line practice with git can actually teach you quite a lot but i don't think you even really need that to really dive in and get get used to this so let's get into some of these extensions so we're going to start off with vs code's built-in git source control so vs code itself comes pre-packaged with git version control which means you can do pretty much whatever you need now there is some configuration you're likely gonna have to set up and on windows it's it is fairly simple you can just install git bash in your system and then um you could also run a couple commands get config dash dash global user.name and then user.email and set up those variables and you're pretty much good to go to just you know pull commit push and using the https protocol instead of ssh and you don't even need to know what that means it's just you can you can install a repo using https that option on github and then you can open it in vs code and actually use git add commit push pulse whatever all those things but by default actually vs code comes pre-packaged with git so you can look at your commits you can look at your file history your branches that you have on that current repo tags stashes stashes are really really cool and useful there's just already you have some tools here but it's not super visual but it's more than the command line you don't need to run command line commands just to see things or figure out things you can just click and see what's going on and sometimes that is just simpler now i personally am a big fan of command line and i will write aliases and chain commands and i know what i know to be really hyper efficient on the command line but for somebody getting started who might not want to be that extreme yet or really deal with that time investment right off the bat these are some great methods now this is just default the actual vs code functionality now we're going to add the extensions into the mix i'm going to start probably with the most popular and widely downloaded ones and then work my way down to some of the more less popular but still pretty useful ones and the first one up on deck is get lens get lens is amazing it's probably one of the most popular downloaded extensions in vs code with over 9.3 million downloads now i did make a little mistake in that source control tab a lot of these little drop down menus look like they're actually from git lens you know i just basically download this thing first time i install vs code so i honestly didn't i couldn't tell the difference but get lens is absolutely amazing because like all those menus you get a visual you know list and you can see everything that's going on in that menu um so like we can see all the different commits and branches and stashes tags that we could see all this stuff visually outlaid and that is incredibly useful but what's also incredibly useful is that getlens gives you a command palette for git commands you don't need to figure out what you need to go and run anymore i can just run the command palette i can say git lens get command palette or you know you can set it to a custom hotkey and this isn't usually what i have it for i actually use this more on my work machine but anyways here's the get lens palette and now whoa all these options you still need to know something about git to really leverage this but right off the bat what do you want to do i want to make a new branch so i can say branch there it is enter what do we want to do i want to create a branch what do i want to branch off of master what do i want to call my new branch um i don't know what repo i'm in oh i'm in my flash read but okay let's just call this feature bam so now it's going to run all those commands for me in the terminal you know let's go to the directory blah blah get branch feature from master and so now i can then say uh let's go to that source control tab and what do i have in branches oh what do you know there's feature made four minutes ago and i can see what's in there nothing because we just made it but already there you go that you don't even have to run these command line commands because this simplifies it for you but let's just say you also wanted to learn what's happening when you make these commands or what what it looks like you cannot also see that in your terminal when it you know does that now i really really like git lens because when you map this to a hotkey you can easily just do things like hop over to a new branch i want to switch to feature switch yes now i'm on my feature branch and i want to switch back to um my master branch now i'm switched back to there i want to go to my branch oops did you do get lens i want to switch or not switch i want to uh branch delete feature i can actually do space and tab and i can actually delete it force delete it if it's on my remote repo i can delete it in both locations with a single command and it just does it and already there it is i could run git branch if i wanted to and it would just say yep there's nothing there but already you can see like once you get familiar you get the hotkey set you get familiar with the commands git lens and the palette make it easy to just run your commands do what you need to do and move on with your life instead of getting bogged down by trying to figure out what each of these granular little git commands do so this is an incredible resource and i highly recommend you get get lens it makes using git a dream the next most popular one that i'm going to talk about is git history this is really useful it's kind of like you know git blame and a git log but again more graphical you have to have an open file or you could actually do this from a git log if you have any other extensions that open the git log for you but in any case i'm actually going to open up this flash script that i wrote for my repo and i want to run git history i'm just going to run get history i'm going to view the file history and now it gives me this long list now i could just pick on any of these things i want to look at oh that one has a tag let's click on that and let's say okay interesting view that and now here's what this file looked like at that point in time if you look at the breadcrumbs here it's actually going to the commit hashes and so this is when the file was at that point in time i could actually uh you know compare file current workspace and do a diff and see what changed from this particular location in history to the current workspace whatever branch i'm on whatever the workspace is it would then show me the difference between those two files at any point for any of the files that i chose compare with previous commit i could see the history of the file which is you know probably what i'm seeing here and we could here's already some other options enter search term search you can search for a branch you can search by author which there are several on this repo and yeah there's just already some really cool options that we have here just to look at your git log and this is incredibly awesome so i can actually filter by let's just say this person i'm gonna filter okay only one commit and then here's what that pull request was and i want to say let's look at this compared to the current workspace and okay interesting this is awesome it makes using your git log and seeing differences at certain points in time compared to other you know other work trees or branches so easy no issues with running get a git log get diff and none of that stuff and dealing with commit hashes it's all again graphical really incredibly useful plugin now this one is probably my personal favorite next to get lens get lens it's right there but i love git graph this thing is awesome you don't even need to run a command for it it's also in the status bar but this thing gives you a graphical view of all of the branches all the different commits and pull requests that have been merged onto whatever branch you could show all your branches or only a single branch you could show your remotes or only your locals and there's even more options in here that i honestly don't even need really but it lets you look at all the stuff outlayed and it shows you all of the different branches and trees i can click on any of these and it will show me not only the full commit hash but the authors the committers dates any of the messages the files that were affected and i can even click on these files and see the diffs wow but even more i can click on some of this stuff and i can say where is i know i can view the git log from this but we can see these files and oh my gosh there's so many options that you have open file view file this revision absolute path yeah there's it's insane because one thing you can also do with this is i can add tags from here i can create branches from a particular commit like even more options to use git but from another extension but honestly what i really use this for is just to see what's going on with all the branches visually because it shows you the entire tree of where everyone's at so at work this is incredibly useful to see what everyone else has connected to you know the remote master repo and this way it's easy to keep track of what is going on in the code base visually with a visual not just text this next one is not as flashy but it is still incredibly useful which is simple language support for git ignore files if you want to ignore a file from a particular repo and you just don't want git to even see that that exists so you don't have to have it in version control this is how you do it and language support makes it a little bit easier plus you could also add a local basically give me a new git ignore file by pulling the file from the github git ignore repository basically give me a template git ignore by running command in vs code i already have one in here i believe oh i do not so let's actually run this command so let's just do that and then say git ignore and we're going to uh add git ignore okay i can't find shell script on here anywhere so i guess there's just no nothing from shell scripts that it expects to ignore so we'll just put c so i put c as like give me a git ignore github give me a git ignore but i'm using the c language here we go and this thing automatically generates all the things you might want to ignore from a c-based project that's pretty freaking cool so that is something that simple that this extension can do for you that is just give me some language support and let me get an easy get ignore file bam now i've only recently started using this one git project manager is pretty darn cool if you have multiple repositories and you keep them all in a single folder on your local machine and you want to quickly hop between them either in the same window or just open up a new project really quickly you can use this extension to say hey i want to gpm project manager i want to open a new project in a new window i actually just used this so i can say open a new project a new window i have it pointed to a particular folder on my machine which is where i put all of my git repos and this lists out every git repo in that folder so i can easily see this and what i want to open let's open up my cv repo in a brand new window and here it is in vs code instead of having to go to the directory right click open with code or go to the command line code you know the dot for the current directory and navigate it's just bam right all here in this project open up a new project this is actually really useful if you work with a lot of different code repos you just have them all there and you want to quickly jump between them git project manager is awesome now this one's a little flashy and i honestly have not used it much but it looks really intriguing and that is code stream code stream makes a lot of really great code extensions and what this one will let you do is if you sign up with their account free and you have this extension in several of these different editors that it supports visual studio jetbrains vs code atom etc and you use git and github this thing will let you basically use their service to you know markup different pull requests add revisions comments inline little different things reviewing it's just a lot of stuff that they open up here it's kind of like a local version of github in your editor but it's using through their service and also github through like i guess apis or something but in essence this is a really great way of doing like a graphical as much stuff in the editor instead of the browser as possible so if that's your type of workflow that you like this could be a really great extension for you i don't see myself really using this too much because i prefer doing things on github itself but hey really useful and really great looking tool it actually looks really nice so hopefully you found that video interesting git is an amazing tool and i really enjoy using it it makes development and working with text and code and plain text files an absolute breeze because it is so robust and powerful and hopefully those get those extensions along with the knowledge and the other videos i mentioned that i've made on git help you better utilize the tool and leverage its benefits for your own projects and needs because even if you're not a code developer if you write anything in text or even just want version control on some files that are text it's a great tool and it would greatly help you and be a great asset to you so on that note i want to say thank you to everyone who helps support this channel and keeps it going there are a lot of you now on patreon and github for sponsors and patrons thank you all for all the support you give to this channel it really makes it motivating to to do this and to make more content and i hope you continue to enjoy what i put out and the best way to support is always github sponsors so thank you to everybody and i will catch you all in the next one [Music] you
Info
Channel: Bryan Jenks
Views: 24,796
Rating: undefined out of 5
Keywords: bryan jenks, vs code, vscode, visual studio code, git, git lens, gitlens, best git extensions, how do i use git, how to use git in visual studio code, what are the best vs code extensions
Id: Guva-oab1pg
Channel Id: undefined
Length: 17min 52sec (1072 seconds)
Published: Mon Jun 14 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.