WEBVTT
Kind: captions
Language: en

00:00:00.030 --> 00:00:03.419
Now that we have our development server
up and running I'm going to explain

00:00:03.419 --> 00:00:07.670
about how we can use our development
server when we're working on our project

00:00:07.670 --> 00:00:13.650
so because the development server is a
virtual machine on our computer by

00:00:13.650 --> 00:00:18.000
default the file system is not
synchronized that means that all of the

00:00:18.000 --> 00:00:21.480
files on our development server are
different from the files on our local

00:00:21.480 --> 00:00:23.100
machine

00:00:23.100 --> 00:00:28.050
vagrant works by creating a
synchronized directory on our vagrant

00:00:28.050 --> 00:00:33.300
server that updates itself with all of
the files in our local project every

00:00:33.300 --> 00:00:36.300
time we make changes

00:00:36.300 --> 00:00:41.070
if you load up the
terminal or the git bash window and then

00:00:41.070 --> 00:00:46.770
connect to our vagrant server I'll
explain to you how this works once

00:00:46.770 --> 00:00:52.559
you're connected to the vagrant server
type cd /vagrant this will switch you

00:00:52.559 --> 00:00:57.140
to the vagrant directory on our server

00:00:57.140 --> 00:00:59.309
now everything in this vagrant directory

00:00:59.309 --> 00:01:04.650
is synchronized with everything in our
project folder so if we create a new

00:01:04.650 --> 00:01:13.170
file in our vagrant project called test
so if we do touch test.txt touch is the

00:01:13.170 --> 00:01:18.360
Linux command for creating empty files
hit enter you can see that this test dot

00:01:18.360 --> 00:01:23.820
txt is automatically listed in our
project folder on our local machine so

00:01:23.820 --> 00:01:29.100
all of the files are synchronized if you
type LS on our server this will list all

00:01:29.100 --> 00:01:32.939
of the files that are accessible and you
can see that this list here matches the

00:01:32.939 --> 00:01:37.979
list here by default when you type LS
hidden files are excluded so you can't

00:01:37.980 --> 00:01:44.940
see dot git or dot vagrant but you can see
license readme dot md text dot txt

00:01:44.940 --> 00:01:50.160
the ubuntu log file and the vagrant file

00:01:50.160 --> 00:01:52.680
if we go and remove this text file from

00:01:52.680 --> 00:01:59.130
our project in atom editor and then go
back to our terminal and type LS you can

00:01:59.130 --> 00:02:03.630
see that the file has been deleted so
the synchronization works both ways from

00:02:03.630 --> 00:02:10.020
the server to our host and from our
host to the server

00:02:10.020 --> 00:02:11.790
okay so how do you

00:02:11.790 --> 00:02:17.200
run code from our
project in our vagrant server I'll show

00:02:17.200 --> 00:02:21.580
you with a simple hello world script so
if you head over to our profiles REST

00:02:21.580 --> 00:02:28.420
API project in Atom create a new file
called hello underscore world dot py hit

00:02:28.420 --> 00:02:32.650
enter and then we'll just create a
simple Python hello world script by

00:02:32.650 --> 00:02:40.900
typing print Open bracket quote hello
world exclamation mark save that file

00:02:40.900 --> 00:02:45.010
now let's head over to our terminal make
sure we're connected to our vagrant

00:02:45.010 --> 00:02:51.880
server type LS and you should see the
hello world script output here now if we

00:02:51.880 --> 00:02:56.530
want to run this code on our server all
you need to do is type Python hello

00:02:56.530 --> 00:03:03.340
world dot py hit enter and that's how
you run the hello world script on our

00:03:03.340 --> 00:03:06.730
server
finally let's go ahead and commit and

00:03:06.730 --> 00:03:09.160
push our changes to github

00:03:09.160 --> 00:03:12.970
so in order
to use git we need to switch back to our

00:03:12.970 --> 00:03:19.120
local machine terminal so either create
a new tab by doing command T or if

00:03:19.120 --> 00:03:24.780
you're on Windows create a new separate
git bash window

00:03:24.780 --> 00:03:26.320
then in the window let's

00:03:26.320 --> 00:03:31.830
type git add dot to add any new files
that we've created

00:03:31.830 --> 00:03:33.700
and then let's type

00:03:33.700 --> 00:03:41.800
git commit - am and then the git
commit message which is configured

00:03:41.800 --> 00:03:48.640
vagrant and set up hello world script

00:03:48.640 --> 00:03:51.010
hit
enter and you can see the files have

00:03:51.010 --> 00:03:56.387
been add now lets push these files to github by
doing git push origin

00:03:56.387 --> 00:03:57.790
this will push all

00:03:57.790 --> 00:04:02.110
of the latest changes that we've made to
github so they'll be accessible in our

00:04:02.110 --> 00:04:04.530
project

