Up and Running with Git Transcripts
Chapter: Our first git repository
Lecture: Local-only repositories

Login or purchase this course to watch this video and the rest of the course contents.
0:00 What if you don't want to host your code on
0:02 Git hub or git lab or something like that.
0:04 You just want to have the features of Git but locally and you're happy to just
0:09 have that local file or that local project structure.
0:11 That local repo for you there to work with your luck.
0:15 All you have to do is type git init in a terminal or command prompt
0:20 and you're good to go. Let's see in source tree.
0:23 We could do new and create a local repository.
0:27 Put it in some location. Notice it will let us create a remote repository but
0:33 not by default. Or if you want to run the terminal,
0:37 you could come over here to desktop.
0:39 We'll talk more about the terminal and some of these widgets that you see here on
0:43 the prompt in a minute. But I can make a directory called local only.
0:49 Go to local only and say git init and check it out.
0:53 We have a local Git repository.
0:55 My prompt actually shows me we're in a repository with the name Master and actually people
1:02 are moving to not use Master anymore but instead to use main as you saw when
1:08 we checked out our other project.
1:10 So I'm gonna go ahead and run that one.
1:11 So I don't see that warning all the time.
1:13 And two just because that's sort of a common standard these days.
1:18 Alright. That didn't change this repository by the way.
1:20 That's for the future. But if you want just a local repository.
1:24 Let's add a file.py And let's add this into visual studio down here.
1:31 I'm gonna go wrap.py and say hello world.
1:35 Well as a comment perhaps or let's go crazy.
1:38 You want to print it right?
1:39 A whole application here. Here we go.
1:44 Notice it has all the git features.
1:46 If I want to git it,
1:47 I can stage this and say ready to release our new app.
1:52 Check here we go. And if we go and put this back,
1:57 we have all the features. You can see the history,
2:00 we've already editor code. So if you want just a local version,
2:04 git init or even just a new empty repository that's disconnected.
2:09 But there's no way to back it up or share it.
2:11 You can attach it to something and some hosted location like github.
2:17 But if you're gonna do that anyway,
2:18 you should start there, as we did at the beginning of this chapter.