• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

TechLila

Bleeding Edge, Always

  • Home
  • About
  • Contact
  • Deals and Offers
Techlila Logo
Share
Tweet
Share
Pin
2 Shares
How to Play Windows Games on Linux
Up Next

How to Play Windows Games on Linux and is Linux Better for Gaming?

How to Use GitHub

TechLila Computer Linux

How to Use Git on Linux

Avatar of Virendra Rajput Virendra Rajput
Last updated on: February 24, 2018

If you have ever been active in the world of software development, you know the importance of keeping track of different versions of your project, which in turn helps you to keep that flow of development as well as to provide better usability. In addition, if you have ever approached experienced people in this field, they would prefer Git, in most cases. Technically speaking, Git is one widely used tool for distributed version control as well as source-code-management purposes with ease. On the other hand, GitHub is a hosting platform for software projects, which make use of Git for version controlling. So if you haven’t signed up for Github, we highly recommend you do so at https://github.com/signup/free.

All repositories in the basic plan of GitHub are public whereas you will have to purchase the premium plan for building private repositories. Rather than a hosting service, the service is something further useful, as it helps in building a community-level development as well as easy publicizing of your software-development projects, based on Git. When both these projects are combined together, it brings an awesome solution for the easy management of your projects. Earlier, we had published one tutorial for using Git in your Windows-powered PC. Now, it is time for Linux, which is also from the open-source power. Hope this tutorial will help you in setting up the special environment in your Linux PC and enabling version controlling in an effective manner.

Basics of Git

1. Creating a Repository

You can create a repository on Github, but you will need to be logged in on Github. If you don’t have an account, you can create one at github.com.

Create GitHub Repo

Here you need to provide a name for your repository, and some description. You can choose to make your repo Public or Private.

2. Set up Your Repository

Once, you have created the repo, Github will provide the instructions to setup your repo with on your local machine.

Setup Repo

If you do not have Git setup on your machine, follow the instructions at https://help.github.com/articles/set-up-git. Now, let’s start with creating a directory and initializing Git.

Create Directory Git

Add a ‘index.php’ file to our directory.

< ?php
echo "Hello git";
?>

Now initialize the directory with:

$ git init

Initialize the Directory

Add the files with:

$ git add

This will include all the files in our directory.

Git Add

Now, let’s make our first commit with:

$ git commit -m "first commit"

Git Commit

Add the origin to our repository with:

$ git remote add origin [email protected]:bkvirendra/my-repo.git

Git Add Origin

Now lets, push the changes to our repository online:

$ git push

This will save all our local changes to our repository online.

Git Push

That’s it, folks!

See also
Linux Hands On: Terminal Easter Eggs and Tricks

Please comment if you have any issues setting up Git on your local machine.

Share
Tweet
Share
Pin
2 Shares

Disclosure: Content published on TechLila is reader-supported. We may receive a commission for purchases made through our affiliate links at no extra cost to you. Read our Disclaimer page to know more about our funding, editorial policies, and ways to support us.

Sharing is Caring

Share
Tweet
Share
Pin
2 Shares
Avatar of Virendra Rajput

Virendra Rajput

Virendra Rajput is an avid programmer and hacker. He is a Co-Founder at Markitty. He is a hardcore Python programmer who is passionate about hacking with various APIs. In his spare time, he loves working on side-projects.

Category

  • Linux

Tags

Git, GitHub

Reader Interactions

What people are saying

  1. Avatar of AbduL GhaFFaRAbduL GhaFFaR

    I just reached to your new Post How to use GitHub on Linux. I know why we use GitHub but I never use it before. I just follow up your tutorial that you have tried to described. Its really nice and easy to use with your tutorial.

    Thanks for sharing useful tips and tutorial for new user of GitHub. Thanks again

    Reply
  2. Avatar of Sourya KharbSourya Kharb

    Very nice tutorial
    I tried linux only one time and its not a good experience for me
    because you have to give too many commands…
    Is their any article that can make Linux using easy
    Then i can try Git…
    Anyway really good article and it help newbies

    Reply
    • Avatar of Virendra RajputVirendra Rajput

      Hey Sourya! The number of commands that you use on a Linux machine really depends on what you are trying to achieve, and the Linux distro you are making use of.

      And since, you are trying out Git, it doesnt matter which Operating system you are working on. Since Git requires you to enter the same number of commands for performing tasks (including commit, push, merge, etc.)

      And as you said, that you had to enter number of commands, can you please share the Linux distro you are worked on and what you were exactly trying to achieve?

      Thanks! :-)

      Reply
      • Avatar of Sourya KharbSourya Kharb

        It is Ubuntu OS
        And i was trying to Root my Sony Xperia X10
        with ADB & Fastboot

        Reply
        • Avatar of Virendra RajputVirendra Rajput

          Hi Sourya,

          Rooting your device is totally a different task, and honestly it gets complicated on any OS (not just Linux).

          Let me know, if you any query/ issue regarding using Git on Linux.

          Thanks :-)

          Reply
          • Avatar of Sourya KharbSourya Kharb

            Thanks for your help…
            Actually i am running a blog for rooting from last 8 months
            I always try rooting method in Windows OS
            EditAndroid

            Reply
  3. Avatar of Matthew PirilloMatthew Pirillo

    A really nice post!
    As we move towards the future we are using Linux distros more and more and also Github is an awesome place to get useful repos.
    Nice post. Will come back for more.

    Reply
  4. Avatar of Aras AndrockAras Androck

    I’ll keep this in mind when i decided to change my operating system to Linux. Right now I’m happy with Windows 8

    Reply

Add Your Comment Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular

How to Increase Broadband Speed on Windows

10 Best Android Launchers of 2021

Things to Do After Installing Windows 10 – Windows 10 Tips and Tricks

Top 10 Search Engines You Can Use to Search the Web Privately

55 Interesting Computer Facts That Will Blow Your Mind

What to Look for When Buying a Laptop – A Laptop Buying Guide

Fusion Drive Vs SSD – Things Nobody Tells you About Fusion vs SSD Storage

Useful Tools

• Grammarly – Free Grammar Checker
• SEMrush – The Best SEO Tool Trusted by Experts
• Setapp – One-stop subscription for Mac and iOS

Trending Topics

  • Android
  • Internet
  • iPhone
  • Linux
  • Macintosh
  • Security
  • Social Media
  • Technology
  • Windows

Worth Checking

10 Best Sound Equalizer for Windows 10 (2022 Edition!)

14 Best VLC Skins that are Highly Recommended and Free

Footer Logo Footer Text Logo

Footer

About

Hello and welcome to TechLila, the famous technology blog where you can find resourceful articles for mastering the basics and beyond.

At TechLila, our main goal is to provide unique information, such as quality tips and tricks, tutorials, how-to guides on Windows, Macintosh, Linux, Android, iPhone, Security and a few miscellaneous sub-topics such as reviews.

Links

  • About
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms

Follow

Custom Theme Using Genesis Framework

Cloud hosting by Cloudways

Language

en English
bg Българскиzh-CN 简体中文nl Nederlandsen Englishtl Filipinofr Françaisde Deutschid Bahasa Indonesiait Italianoja 日本語pl Polskipt Portuguêsro Românăru Русскийsr Српски језикes Españolsv Svenskatr Türkçeuk Українськаvi Tiếng Việt

© Copyright  2012–2023 TechLila. All Rights Reserved.