>> Hi, welcome to another episode of the On.NET show.
Today, we've got Jasmine Greenaway with us
and we're going to
learn a bit about how
GitHub and Visual Studio work together.
So tell us a little bit about yourself and then,
we'll jump into the topic.
>> Absolutely. So, my name is
Jasmine Greenaway, as you said before.
I am a cloud developer advocate here at Microsoft.
Pretty much what I do is I get
to talk about all the fun things that
devs can do with the cloud and I get to show them
how to do that with words and codes.
So, I'm either writing or
speaking or writing code to show them how to do that.
Previously, I worked at GitHub.
And I worked on the GitHub extension for Visual Studio.
And it was a lot of fun and I'm
really excited to show it off a little bit.
>> So you're totally at home in this space then?
>> Yeah for sure.
>> Awesome. Yes, so a few years ago that's
when GitHub or how long ago was it
the GitHub actually made
the GitHub extension for Visual Studio?
>> It started I believe in the end of 2015,
just before I joined.
So, it was effort with a few devs
and they got in this about
a five person team now. And it's gotten larger.
And, it's a GitHub Visual Studio extension that was
written with WPF and it uses
the GitHub API to
make calls and stuff like that. So yeah.
>> Definitely. Because I think with a lot of people,
GitHub is clearly one of
the big hosting git servers that people use in the world.
So, having first class support
for GitHub makes a ton of sense.
>> Yeah for sure.
And, it's like it's completely
transparent because all open source so,
everybody can see what's going on with it.
>> And I assume this I know GitHub has
both public and private repositories.
I assume this works for both.
>> Yes.
>> Yeah. Makes sense.
So, I think there are a lot of people
that are using git with Visual Studio for the first time.
They've heard that git's a thing.
They probably used some other source
control manager in the past.
Maybe they'll install the GitHub extension
for VS to get started.
Do you think that it
pretty much has all the functionality
that most people need to get started
or is there anything else that they need to learn?
>> Yes. So it has most of the features to get started.
So, whether or not you want to pull down or
clone a new repo or create a new repo on your own.
Or even commit a few some code,
whether it be your code
from your repo or somebody else's,
you have the option to do that.
And you also have the option as a maintainer to go
through all of the open or pull requests,
that might need some attention and review that and make
comments on that right in
Visual Studio itself without even
having to go to the site.
>> So one of the things I love about git and
GitHub is it's pretty much centered around collaboration.
>> Yes.
>> And so, like,
so we use git and GitHub a ton on
our team and we
try and be as collaborative with it as possible.
So, maybe what you can show us is,
if you're as collaborative as you and I are,
some of the features in
the GitHub extension that enable that.
Like you were showing me before,
how comments show up in line.
I felt that was super compelling.
>> Sure. So, yeah,
I'll show that off real quick.
So what I've done here in
Visual Studio is here's the extension
and I went ahead and I created a new repo.
And you can see it down in
the bottom corner here called "My new repo".
And I have a test branch here that I,
you know, just for fun.
And what I've done here is I have
an actual separate GitHub account called evil paladique.
So my handle on GitHub is paladique,
it's a long story, ask me about later.
But, I have a test account
called evil paladique and what I've
done is that I've created a poor quest with the evil one,
and I went ahead and did with my real account is
made a comment to that pool quest.
Especially right in the file.
Not like a general comment, just right in the file.
>> Right.
>> So, if I.
>> Which is super common on that kind of how things work.
>> Yeah.
>> On GitHub.
>> Yes exactly.
So, I'm right here,
I'm in my new repo repo and I have
my poor quest here
and you can see I can actually go to it.
I can go to the site if I wanted to,
but I'm just going to click right here.
I have the details.
I didn't put a description here and I can actually,
view the rest of it on the site if I want to.
But what I'm going to do is just go ahead and click on
this comment button here, this comment link here.
And, so what evil paladique
did was add some new text to my readme file saying,
just adding some new text. That's all she said.
And what I did was, I went here and added a comment.
Now, I actually did this on the site.
But if I wanted to add new comment here,
this is a new comment and I press comment here,
you'll also see this on the site.
So if evil paladique had
a version of Visual Studio
that with git the extension installed,
they would be able to see it as well.
So if I go in views,
actually view is conversation,
you'll see that my comment is there.
>> 16 seconds ago.
>> Yeah.
>> So what I kind of hear is, in the past,
to fully participate in a kind of
collaborative GitHub process,
you had to be on the website.
>> Yes.
>> And, now we've made it so that Visual Studio users
can just pretty much stay in Visual Studio
and really kind of have no downside.
>> Yeah.
>> They just get the whole collaborative process.
>> Right. It's great because for me
as somebody who's been using Visual Studio for years,
I have everything that I need there.
I have my code but also I can manage my packages,
I can manage, just any kind of files,
everything I need mostly is in Visual Studio.
And with the addition of git integration and also GitHub,
it makes it a lot easy for me to be collaborative
right in Visual Studio without
having to jump around too much.
>> Make sense.
Another thing I like about
GitHub and I'm not sure if we can see it here but,
syntax highlighting is really great for.NET languages.
>> Yes.
>> Yeah.
You can probably see that.
So it has, that's a kind of like
a first class characteristic and.
>> Basic.
>> Yeah. So, looks like it should.
So, I certainly feel super comfortable.
So the other scenario,
we've started talking about the new users.
So, I'm one of those kind of dyed in the wool.
Use git from the command line,
and I actually use,
the default Vim editor for typing on my comments.
Although, most of the time I'll
just do them the command line with
the dash M keyword,
just to type my message.
What am I missing in Visual Studio?
What would compel me to get out of the cold,
on the command line and come
in to the warmth in Visual Studio.
>> Well, the git integration in VS,
has the very basic capabilities.
So, there's definitely going to be
things that you're going to need in the command line
proper for example, things like rebasing.
You can do merge conflicts in Visual Studio and that's
like definitely an option for you.
But if you want to do all the command line you're
available to, and Visual Studio
is not going to stop you and say like,
"Why did you do that in the command line,
you shouldn't done it here".
>> Totally.
>> So there's things like that and.
>> So, maybe it's merge conflicts would be
the thing that would bring me into visual studio,
because I will say that handling
merge conflicts in Vim is not super awesome.
It's like, here's the stuff coming from one direction,
I can't even remember what it's called and here's
incoming and here's current or whatever it's called.
>> Target branching.
>> Incoming and head I think it is.
>> Yeah.
>> And then, it's like,
I can never remember which direction it is.
>> Yeah.
>> So, maybe VS would help me with that.
>> Yeah for sure. We are
different editors call it different things,
so especially if you're coming from
Vim to like Visual Studio to get there
probably a little bit of a learning curve in terms
of what they call things there.
But, yeah. Visual Studio
can definitely help you out with that,
and I'm trying to think if there's
any other concepts in terms of,
on the command line that you'll want to use,
a command line specifically for it but none come to mind.
But the other great thing with
Visual Studio and again integration is that,
there's an option in Visual Studio that allows you
to jump straight to command line if you'd choose to.
So, if you go into team explorer here in
Visual Studio and you actually go to home,
the connect page here and so you have your list of
GitHub post repositories and then you have
your local repositories here,
and say I want to
check out my new repo in the command line,
just right click here and I go to open
command prompt, and there I am.
I'm there and I can do whatever Git commands I need to.
>> Git status.
>> Yeah, git status or whatever you'd like.
>> Yeah, so one thing that people might not know is,
so gitignore is a pretty important concept.
And there's actually a gitignore file for Visual Studio.
>> Yes.
>> So whenever I start a new repository,
I type in my search
engine,.gitignore Visual Studio and
it always takes me to that file
which is actually on GitHub.
>> Yeah.
>> And then that helps a lot.
>> Yeah. And then
the thing with the extension is it
also includes it as well.
And not only does it include creating,
adding the gitignore file,
it does it by default,
or add it for you by default,
but you can also add a license.
So, if you decide,
"I need an MIT license here",
it'll grab that for you.
It's a totally optional up to you.
And then, you also option of making
a private repository before you
even send it off to GitHub.
>> Nice.
Can we just cover what the gitignore file is for,
just in case people don't know that.
>> Sure. So gitignore file is pretty much
a file that overlooks,
if the file is in the gitignore files.
So anything that isn't
a gitignore file will not be committed,
not be pushed to GitHub,
not be pushed to whatever your
source control hosting services.
>> Yes. Because there's,
a ton of files that are just
completely inappropriate to check in.
Mostly binaries, I think that's your number one thing.
And it just makes
your git life so much
easier and it avoids a ton of mistakes.
>> Yes, exactly.
So, it's very handy and it's
very helpful to have it just there available for you.
>> Okay. Where do I install this?
What does that look like?
>> Sure. So if you go to
the GitHub for Visual Studio repo,
you will see all everything has been going on with it.
What everyone is pushing,
what kind of hood everyone's pushing,
what kind of features are next.
But there is a link up here,
right in this description called visualstudio.github.com,
it'll take you to the site
and you can download from there,
or you can go into extensions in Visual Studio,
under tools, extensions and
updates and just search
for GitHub extension for Visual Studio.
>> Okay. So for a lot of people that's
probably the easiest path.
>> Yes, exactly.
>> And then you just kind of install
it and you're off to the races.
>> Yeah. And just your typical install,
restart and it's there
and then all you have to do is just log
in and authenticate if you have 2FA on.
>> Yeah. 2FA.
>> Yeah, i'll do gits 2FA.
>> As Microsoft employees
you're actually required to use that.
>> Yes we are.
>> That's security.
>> And yeah. And then,
you just go ahead you can clone some repos of your own,
create a new repo,
add any existing repositories
and they look for repository,
you can add it in Visual Studio
and then if it's hosted on GitHub,
it'll show up in your list of GitHub repos.
>> Awesome.
>> Yeah.
>> Well, I think I'm going
to be giving up my Vim habit pretty soon now.
So, any closing thoughts?
>> No. Just check out the repo,
check out the extension.
If you see something that you find
interesting or like a interesting feature,
go ahead and send issue
or send the issue to sends and
love if you like it, and yeah.
>> Yeah. And it's free use.
>> And it's free to use.
>> Awesome. Well, thanks for
listening and watching another episode
On.NET show and today I was
with Jasmine Greenaway and we learned
about the GitHub extension for Windows.