Tuesday, November 19, 2019

author photo

Learning Basic Git for Development

Hello there again, it's me that little boy who learned how to code with his 1gb Ram mini hp laptop in his room.

Today I am not going to bore you will much talk and fancy words even though I am not good at spellings. We are just going to learn how to use Git and if you don’t know what Git it, I will suggest you go read this article:- Why You Should Use Git and GitHub Early a Junior Developer

And if you want to know why you should learn Git, I suggest you go read this article too:- 10 Important Things Every Web Developer Should Learn

Like I said, I’m not here to bored you will much writings and bug words, we are just going to go straight to why most of you came here.

Working With Git (Basic Commands)

The first thing to do is to go to the git website and download the git terminal, which is the best terminal to use. For me? Yes, it’s the best, people use other terminals.

Now after downloading and installing the Git Terminal, you need to run it. And please if you don’t know what git is, I have an article that explains what git is.

Okay after doing all that, go to your project folder where all the code are, now right-click on your mouse and you will see Git Bash, click on it and the Git Terminal will be open to you.

Now the very first thing to do is to initialize the Git empty repo in your project folder. This is where Git will store all your commit and push it to either your GitHub account or GitLap account, any of them you might be using at the moment, the choice is yours.

Okay, after doing that, we want to make sure that you did the right thing, type “git status” and you will see all the code that’s in your project showing red. (For some reason I won't be adding images to this article, if you want the images, please drop a comment and your mail address).

Now seeing that all those files are showing red, those not mean your code is bad. No trust me your code is not bad, it just means all the code in the project folder has not been added to the git local repo folder.

Now type “git add .” and yes that is a dot, what is the meaning of that dot? The dot means you are adding all the code and files that are inside the project folder to the local Git repo. And type “git status” and press enter you will see all those files and codes that were red, showing green. That means they are all added to the Git local repo.

Now wasn’t that easy? So what next, you need to commit and push the projects to your GitHub account, but I will cover how to push, pull and clone on the next article, because this one is getting long, and it won't be nice reading a long article that explains how to use code, I have been there, it's really boring.

So you need to do it to practice this few command lines I showed you today. Which are:
  •  git init
  • git status
  • git add .

and yes if you don’t want to add all the file and code you can easily select which of the files you want to add to the local git repo by type “git add <file name>” for example “git add index.html”. that is it, it’s as easy as ABCD, yeah, the next article we are going to be going deep into git, for now, just play around with these few lines.

Thanks for reading and if you have any issues with anything or you have a question, please drop a comment.

Read More here:

Next article Next Post
Previous article Previous Post

This post have 0 comments


Next article Next Post
Previous article Previous Post