Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • git Installation on Ubuntu

    • 0
    • 2
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 428
    Comment on it

    git Installation on Ubuntu

    Installing GIT on locally : Git is a open source project version control system. Before you start using Git, you have to make it available on your computer. Even if its already installed, its probably a good idea to update to the latest version. In Ubuntu OS you need to run following command to install the git.

    $ sudo apt-get update
    $ apt-get install git

    Create Repository :

    Initialinzing repository in local directory :

    $ mkdir <project-name>
    $ cd <project-name>
    $ git init

    The git init command will create a new repository inside the selected folder.You can also convert an unversioned project to git repository using git init command. Actually git init command create a .git subdirectory inside the project root, this subdirectory contains all the metadata about the project. If you want to create the repository from outside the root folder then you can run following command :

    $ git init <path-to-directory>

    In the above command you can replace with your project root path which you want to versioned or track for changes.

    Now what if you want to share your repository to multiple users.If you create your repository from git init command the repository will contain working copy also. But if there are multiple users of your project who want to changes files and commit.So to share your repository to other users you need to create a bare repository. For creating a bare repository you need to run following command :

    $ git init --bare

    The --bare option will create a repository that doesn't contains the working directory of project.

    Git Configuration :

    Your identity : The first thing you should do when you install Git is to set your user name and e-mail address. This is really important because every Git commit uses this information:

    $ git config --global Test
    $ git config --global

    Checking your configuration :

    f you want to check your configuration, you can use the following command to list all the settings Git can find at that point:

    $ git config --list

    You can also check what Git thinks a specific keys value is by typing git config : e.g

    $ git config

    Getting Help :

    If you ever need help while using Git, there are three ways to get the manual page (manpage) help for any of the Git commands:

    $ git help <verb>
    $ git <verb> --help
    $ man git-<verb>

    For example:

    $ git help config

    Click on the Link For Getting a Git Repository

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: