fetch

How to use Git inside of VSCode



Sharing buttons:

hi there it's been in here again the guy

who hates models but Australian

development in two days vs code tutorial

you will learn how to use git inside of

vs code how to clone repository how to

update it comedy - she pull it you learn

a lot but before we do that don't forget

to hit the like button subscribe to the

channel for more videos like this the

first thing you'll need when you're

working with kit inside of vs code is

the repo URL so I've created this simple

vs code git repo there's only readme an

index.html and we'll be checking this

out making some changes committing them

pushing them and just the general

workflow of how you work with get inside

of vs code okay so the first thing we'll

do will click on this green clone or

download button and copy this URL and

that's what we'll use when we jump to

the vs code and inside of the Welcome

page we'll click on the clone git

repository we'll click on that we'll

paste the URL in hit enter and now we

need to specify the path where we want

to save our files I'll copy paste the

URL of my folder and this is the

location where I want my files to be

saved on my local computer I hit enter

and now you saw the message cloning git

repository down here would you like to

open cloned repository and we'll click

open repository

now we have the local version of these

files we can make any changes to them

and then we can commit them into the

repo so let's say that we want to delete

this line of code and save the

index.html now when you go to the git

tab you'll see that there are some

changes okay so when we click on the

changes it shows us exactly what

happened so the minus means that the

line was deleted and this is our version

so on the left is the version from git

and on the right side is our local

version if we revert back the change

save it you'll see that the notification

of the changes goes away also if we save

it we can revert the changes by clicking

on this arrow back discard changes it

will be the same thing as if we revert

back to how the repo was when we cloned

it initially if we just change the name

here and save it you'll see this blue

line over here and that means that the

file has been modified if we delete a

file let's say I delete the readme file

for now

you will see that the change is jumping

- - and readme is deleted okay I don't

want to delete it I want to revert it

back so I click on the discard changes

and the file is downloaded back now we

will explore the get interface in more

detail this tick button means that we

can commit our changes this one will

refresh so it will synchronize and these

three dots are hiding the remaining git

commands the most frequently used and if

you want to see what is happening under

the hood when you pressing some of these

buttons you can click on the show get

output and here is a log of all the

commands so this is handy if you want to

learn exactly which of the git commands

are executed

now we will edit the file we'll add one

more paragraph Peter was here and we

will save the changes and we want to

commit them okay so we will go to the

message and with every commit you should

be writing some meaningful message what

has changed

extra paragraph and then we can commit

by pressing command and enter okay so

come on and enter it's the same thing as

if you would click on this icon but I

prefer the keyboard shortcut command and

enter and that is synchronizing our

changes as you can see down bottom here

we see that there is no changes to pull

but one change to push okay so we just

changed we just committed it locally and

for us to be able to see the changes in

the actual repo we need to push our

changes okay so we click on push and the

changes are synchronized once it's done

you'll see there are no changes and we

will see the Peter was here inside of

our repo if we refresh the page the

index.html has the Peter was here change

now let's pretend that someone else was

working on this project made some

changes to it and we want to get the

latest changes okay so somebody somebody

else was here we will save the file

commit the changes without any message

and now inside of our vs code we want to

get the latest code and update our local

version to what Evers inside of the

master we can simply click on the drop

down click on pull and it should get the

latest version from the server and

update our local files now we have that

somebody else was here and this is how

you pull the latest code from the server

and that's it all for today hope you've

enjoyed this miniseries about vs code I

would really like to know what do you

thought about these last five videos let

me know if you have any questions or

favorite extensions I want to see your

comment down below until next time happy

coding bye

[Music]