## Git - My Completely Basic Beginner's Guide Part 1 As part of the reason for creating this blog was to increase my web development knowledge, I thought it would be a useful idea to put down a few of my thoughts and experiences of trying to figure out web development with _zero_ prior knowledge. I'll be writing two posts about Git, the version control system, and how I used it when I first started development. For these posts, I won't be talking about what git is or why you should use it - there are plenty of sites with that info written by authors far more knowledgeable than me. Instead, I'll be showing you the steps I took to get started, and then how I integrated this with GitHub. Please bare in mind that these are very basic tutorials - part of writing these posts are for my own learning as well rather than as an expert trying to pass on knowledge. _Please note, all my work with git was done on a laptop running Ubuntu 16.10 and might not work on Windows._ ## Git Firstly, make sure that you have git installed. On Linux, this can be done by running the following in a terminal: ``` sudo apt-get update sudo apt-get install git ``` Next, navigate using the terminal to where your project is. For example: ``` sam@sam-X550CC:~$ cd dev sam@sam-X550CC:~/dev$ cd samhillman.github.io sam@sam-X550CC:~/dev/samhillman.github.io$ ``` and then type: ``` $ git init ``` to load, or initiate, git. git is now started, and we can start to keep track of our files! Now when we have written some code, or want to save some work, we first of all need to **add** the files and then we need to **commit** them. To add the files, use ``` $ git add --all ``` which will add all the files we have been working with. There are other things we can do here with the **add** function, but for now we won't worry about it. Next, we need to commit our changed files by typing ``` $ git commit -m "and write your commit message in here" ``` Now that we have initiated git, added all of our changed files and then committed them, we would now usually **push** them to a remote repository - and this is where GitHub will come in. ## GitHub The great thing about using git and a remote repository is that you can access your files anywhere with an internet connection. This is great for collaboration, but can also give a solo developer a lot more flexibility and security. In the next post, I'll be going through how to use GitHub, how to get information and code from the site to your computer and vice-versa.