Subtitles section Play video Print subtitles - Hi, I'm Matthew. - And I'm Brent. And we're gonna talk to you about Git, the version control system that brings the distributed nature of working with repositories on your local machine, or on the web, to the lineage that is CVS and Subversion. [GitHub & Git Foundations] ♪ [music] ♪ [Introduction: Git] One of the things that I love so much about Git is that everything I do is local on my laptop until I tell it explicitly otherwise. So if I don't have any internet connection, no problem. I can get some work done, and finally when I do get to that internet connection, I can send that data back to the remote server, and get some more work done. So, I can start with a repository on my local machine, eventually, when I need to collaborate, put it up on the web or some other hosted solution, and this gives me the flexibility of both. Everything that I work on can be under version control. But my question that I always start with is, "What tooling am I going to need?" The command line isn't the only option for us to use when working with Git. There's different graphical user interfaces for all of the major operating systems. That means Windows, Mac, and Linux even, have their own graphical user interfaces but also come bundled with command line tools to use. If I think about, "How much will I need to learn to be productive with this?" Roughly ten commands and, give or take, ten button clicks will be sufficient to allow you to use this for your daily software development needs. [Introduction: GitHub Social Coding] ♪ [music] ♪ So Brent, we talked a little bit about the foundations of Git, the tool, the command line, GUIs, how it starts off with a local database and then can be pushed to the web, but what I'm interested in is when I'm starting a software project, why would I want to create the repository locally and how does Git call that distributed version control? So the idea of creating this locally allows us to just start a project from fresh, right there on our command line, or with one of the graphical user interfaces, we can just say git init new project and that'll create a folder right there in our file system called New Project, and if we went ahead and moved into this directory structure, we'd see that it contains just a simple .git folder, which is really all that we need to do any amount of our work. We can then dive a little bit deeper into this .git folder to see some of the internals, and really get an idea for how Git is persisting some of these objects as well. So the .git folder is just that, a folder, with some simple files. And these are mostly plain text, this is where everything gets saved as we make historical evolutions to our source code and the project, and the nice part about this .git folder is that every one of the Git and GitHub tools writes to it. Whether it's GUI or command-line, it simply writes to the .git folder. Close the laptop, put it to sleep, it's all persisted. Now what about when I start to want to add remote destination? When I want to collaborate with somebody else? We've been talking about saving it locally, having it persisted locally, but what about getting it to someone else and working with them on source code? So when you want to interact with a different remote, whether that be GitHub.com, or even your own friend's laptop, you could set that up by creating a different address inside your config file. This is just another place for Git to begin reading from, to understand where it's sending data to, but also where it can pull data from. So this idea is simply, again, just reading into the text file, and letting Git know there is this address out there that I want you to get information from, and possibly send information to, but again, only when you specify. So we set up this address, it can be inside your network, if you have a self-hosted solution, it can be on the web, if you're using GitHub.com, the tools know how to speak with this, and your primary work still happens on the laptop, locally, not with network access, but then occasionally as you need to collaborate with others and share that code with them, you use these two commands I heard you say, - Push and Pull. - Yep, that's right. [Thanks for watching.] ♪ [music] ♪ Thanks for watching this introduction to Git. As always, don't forget to subscribe to GitHub Guides, and check out all of the other amazing videos from GitHub. Feel free to ask comments and questions down below, we'll try to address those in an upcoming video, and if you like these training materials, check out these guys, right down here. ♪ [music] ♪
B1 git github folder command line locally laptop Introduction • GitHub & Git Foundations 66 8 Mickey Fly posted on 2014/04/06 More Share Save Report Video vocabulary