Playing with the Octo-Cat

After I done with setting-up dev environment, next task of Hasura Internship was to learn git basics.

https://octodex.github.com/images/dojocat.jpg

Git is not a programming language or an IDE

About Git

Git is the most commonly used distributed version control system. Git is a mature, actively maintained open source project originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel. GitHub is a company that provides a platform to do version controlling Git allows a team of people to work together, all using the same files. And it helps the team cope with the confusion that tends to happen when multiple people are editing the same files. Version control in simple terms is nothing but making flags/check points as significant changes are made to your code/work so that you can always go back to whichever version was last working properly or whichever version you want to use at the moment.

Why Git and Github?

Version control is the only reasonable way to keep track of changes in code, manuscripts, presentations, and data analysis projects. Before using git, I was unable to keep track of my changes (although majors, but not every small part), exploring the difference between old code and update was very difficult. When I started using git properly on my projects, it was easy to differentiate even each small changes. It made my life easier in coding.
Merging collaborators’ changes made easy. The main problem arises when we have to deal with the collaborator of project, when he/she send you modifications distributed along many files. It become very hard to merge each and every changes manually. Git made it so easy with only one command: git merge.
Github is like facebook for programmers. Everyone’s on there. You can look at what they’re working on and easily peruse their code and make suggestions or changes.
It’s really open source. We can easily study it. With Github all of the code is easily inspected, as is it’s entire history.
We don’t have to set up a git server. Just install git on the machine and go. It’s very easy to get things set up when we are using it for the first time.


Learning Git

When I started with Octocat , I used this website to learn basic commands.To start work, the first thing we need is to install git on our system. The best way to learn git is by using it in the terminal. There are GUI clients for Git, but I prefer working on the command line. I wrote commands and practice on my computer and gone step by step.

Some Basic Commands

These are some basic commands and their descriptions -
$ git init : This command is used to initialize a Git repository. After executing this command directory now has an empty repository in /.git/. The repository is a hidden directory where Git operates.
$ git status : This command is used to check status of the project at any time.
$ git clone <url of project> : This command is used to copy a project repository to our local system.
$ git pull : That pulls the latest changes down from github. If there are conflicts between those and my local ones, it tells me what they are, file-by-file, line-by-line, and I now have a chance to reconcile those differences.
$ git add <file name> : After adding a new file to project, we need to add that to out git repository. Multiple files can be added at the same time.
$ git commit : This command records changes to the repository. This adds changes to the local repository only until those are pushed.
$ git set remote : After making commit to local repository, we need to add remote repository on Github.
$ git push : Using this we can add changes to Github repositories.
$ git pull : Using this we can download the latest changes from Github repositories.

What's next?

Next post is about setting up local development on my computer. Stay Tuned!

Comments

Popular posts from this blog

User Feedback & Testing of White Board

Idea for an app | First step to internship