Monday, May 11, 2015

Building a Blog - Setting Up, Git

All right. As previously said, I am going to set up Git for our Blog project. I will be using Git so if you don't have an account you should create one. Again, I encourage you to read how to use Git hub on their official page. But I'll go through some basics as I am setting up Git for my needs. If you haven't read my previous post about starting this project you should read it to see what is this all about. Here Building a Blog - Simple and Small start with MVC.

Once you are logged into your account, first a Repository. Just as a name says it, we will store our data, files, folders from our MVC project in this repository. Just as you would on any other cloud service. So let's create one:

1. Click on the green button saying +New Repository.

1. New Repository

2. Then write a name inside the "Repository name" box. I will call mine DusanBlog. You can call it however you wish. I am calling it with my real name as I want to have a personal blog. And inside description write something that would describe your repository.

2. Repository Name and Description
Leave "Initialize this repository with a README" unchecked. If you check this, it will already set few files inside your repostiory and I don't want to confuse you later with how you will have to pull and push folders and files to repository online. Again, making everything simple as it can get. So you should click "Create repository" button with README unchecked and just think "I made a repository in the cloud".

After that you should have a screen like this.

3. Repository ready for work

The link you see in the "Quick setup" part of the page, is what you will need, as you will have to give to Visual Studio link to where to upload your changes you will be doing in a project. So write it or something or keep the page open. As you can notice you have "We recommend every repository to include a README, LICENSE and .gitignore" and also steps you can use to "create new repository on the command line" or "push an existing repository from the command line". 

Now you might ask yourself "but what the hell?! I just made a repository and it is asking me to make a new one?! What did I just do then?" We basically just set a name for the repository. To be a fully working repository that you can download you would have to do one "commit" as it is being said in a part with a command line. But if you do this you would create those few files and it will make a bit of confusion with what is going on. You will make those files once you create a new project in Visual Studio. 

So to summarize what we have just done, you should think of it like "I have repository waiting in the cloud to be uploaded with something". But again, you should check how to use command lines on their official guides and guides at all. In fact, you should always check additional info if you can't get to understand something. You simply can't find everything in one place. If you ever watch or read a tutorial just to have something done, that's the wrong approach in my opinion. You should first get interested in how something works when you want to do anything, once problems start showing up then you should get help from tutorials. I've seen tons of people going "when I show it to my employer, he won't know it is from a tutorial..." sure thing he won't, but then you will have a problem you don't find in a tutorial and then what? Guess who is going to the gallows pole?

Either way to finish this up , we made a Git Repository and in next post we will upload our MVC project to it.