Setup Menus in Admin Panel

  • No products in the cart.

  • LOGIN

Git Basic concepts

Git Introduction


Git is a distributed revision control and source code management system with an emphasis on speed. It is mostly used for computer code. Git was initially designed and developed by Linus Torvalds for Linux kernel development. Git is a free software distributed under the terms of the GNU General Public License version 2.
Version Control System (VCS) is a software that helps software developers to work together and maintain a complete history of their work.

 

Advantages of Git


Free and open source

Git is released under GPL’s open source license. It is available freely over the internet. You can use Git to manage projects free of cost.

 

Fast and small

All most the operations are performed locally, it gives a huge benefit in terms of speed. Git does not rely on the central server. There is no need to interact with the remote server for every operation. The Git is written in C language.

 

Security

Git uses a common cryptographic hash function called a secure hash function (SHA1), to name and identify objects within its database. Every file and commit is check-summed and retrieved by its checksum at the time of checkout. It implies that it is impossible to change file, date, and commit message and any other data from the Git database without knowing Git.

 

Implicit backup

The chances of losing data are very rare when there are multiple copies of it. There might be chances of disk corruption or system crash so git is the better option for backup.

 

No need of powerful hardware

In case of CVCS, the central server needs to be powerful enough to serve requests of the entire team. For smaller teams, it is not an issue, but as the team size grows, the hardware limitations of the server can be a performance bottleneck. In case of DVCS, developers don’t interact with the server unless they need to push or pull changes. All the heavy lifting happens on the client side, so the server hardware can be very simple indeed.

 

Easier branching

CVCS uses cheap copy mechanism, If we create a new branch, it will copy all the codes to the new branch, so it is time-consuming and not efficient. Also, deletion and merging of branches in CVCS are complicated and time-consuming. But branch management with Git is very simple. It takes only a few seconds to create, delete, and merge branches.

 


 

Github vs Gitlab

Public repositories on GitHub are used to share open source software. Similar to GitHub, GitLab is a repository manager which lets teams collaborate on code.GitLab offers some similar features for issue tracking and project management as GitHub. If you are going to collaborate in the team then go though gitlab.

 

Getting started with gitlab:

Step 1:

Create a gitlab account. Visit the official website https://about.gitlab.com/

 

Step 2:

Create a project name. Here I have provided a project name as a blog.
After creating the project name you will see as in the screenshot below:

 

 

 

 

Step 3:

Now set up the username and email by typing the following code:

git config --global user.name "Ganesh Khadka"
git config --global user.email "[email protected]"

In my case username is Ganesh Khadka and email is [email protected]

 

 

 

 

Step 4:

Now follow the command which is in the existing folder.

cd existing_folder
git init
git remote add origin https://gitlab.com/ganeshkhadka/blog.git
git add .
git commit -m "Initial commit"
git push -u origin master

 

 

 

Step 5:

After the completion of the set up check the status

git status

 

 

 

Step 6:

Initially, you will see the file name in red color.But after performing the command i.e git add .
you will see the file name appearing in green color (You need to check status by typing git status)

 

 

Step 7:

Now perform the initial commit by typing the following command:

git commit -m "Initial commit"

then check the status by using the command

git status


 

 

Step 8:

Finally, push the project into the gitlab by following the command:

git push -u origin master

 

 

 

Step 9:

You have successfully push your project in gitlab.

 

 

Attachments12

ASSIGNMENT : How to push repository in Gitlab? MARKS : 5  DURATION : 5 minutes

ASSIGNMENT : How to clone repository?Give example. MARKS : 10  DURATION : 10 minutes

SEE ALL Add a note
YOU
Add your Comment
 

Advanced Course Search Widget

Popular Courses

Course Categories

© PHPhelp. 2002 - 2018 All rights reserved.
X