Skip to main content

Getting Started with Git & GittHub


Creating a Git Project

Git is a version control system that keeps track of the files in a project. In order to use git, we start by identifying a folder as a git repository. we do it by running init command in the folder. Before running the git command go to your project folder and create two files called file1.txt and file2.txt and add some sample text to it and save the file. Now open up the git command line in the project folder and type the following command. An easy way to is by right clicking anywhere inside your project folder and click git bash here.

$ git init


Checking Status


Now we created a git repository. Now we can check the status of our repository by typing git status in the git terminal.

$ git status



You can see there are two files in red which called as untracked files. This is because we still didn't add any file to our git repository.

Adding files to Git repository


To add files to your git repository by simply typing git add file1.txt. This will add file1.txt to git repository.

$ git add file1.txt

If you want to add multiple files you can type

$ git add file1.txt file2.txt

But if you want to all the files to in the to your git repository, you can do by simply typing the following command. This will add all the files to your git repository.

$ git add .

Now, if check the status git status we will see the output like this.



Now we can the file1.txt and file2.txt in green colour which means git it now start tracking our files. So now the all the changes we do our file will keep a track.

Committing files


Committing means like we are telling git to keep a checkpoint of our current working file. We something goes wrong in the future we always can come to the stage where we were. Also, this commits helps develops see what files are changed and what modifications are done through the project. You can commit using the following command.

$ git commit -m "Commit Message"


Adding project to GitHub


Git hub is a place that keeps and manage your repositories. It helps manage a project with other developers with a very simple and easy manner. So now let's add our project to GitHub. First of all, you need to have a GitHub account with is easy and create and Free. Go to https://github.com and create your account. After creating your account create a repository.



Now type the following command in the git terminal. This will allow git add files to Git Hub remote repository. You will ask to enter your GitHub username and password.




Now if you refresh the GitHub page you will be able to see your files.



Comments

Popular posts from this blog

Working with Yeoman

Let's take a look at Yeomen. Yeomen is not part of MEAN Stack but allow us to quickly get startup providing us with generators that can create starter temples. It helps to setup the links between some or all the components of MEAN Stack, without having to do it all by hand. We will be focusing  a developing an app with MEAN Stack in the tutorial. Let's begin installing Yeoman using npm . $npm install -g yo Now that yeoman is installed we can next install a generator with it. Let's head to yeoman . io website and click discover generators. We going to use the gulp-angular generator. It will save us a lot of time setting up some tedious tasks that make our development process much faster. Gulp allow us to automate tedious and dependent tasks which are moving files over to publish folder or linking libraries or packages that needed our app. Click the gulp-angular generator and we can see the dependencies we need to install in order to run it. So let's o...

What is an API?

What is an API? The definitions given by WIKIPEDIA - set of   Classes   definitions, protocols, and tools for building   application software. HowStuffWorks- set of programming instructions and standards for accessing a web based software application or web tool. Quora - A contract provided by one piece of computer software to another. If I was to answer that question I will simply say that API is an interface that hires the details of an implementation. For example, the interface retain on a computer has a power button. This is one function of the interface computer manufacture gives us. APIs are usually used for three things. They are used for Performing tasks. For example, we may use tutor’s API to search with reach from Sanfransico.  Retrieving data.  We may use face . -force to achieve receivers friend list.  Manipulating data.  For example, we use android API to add a new contact. What is a web API? A web API...