Skip to main content

GIT installation on ubuntu basics

GIT is a free & open source, distributed version control system and it is identified as the most fast version control system in comparison to the other VCS like SVN. Also git is distributed and so you can use it off-line  also. 'Distributed' here turns out to be every development machine being a git repository of it's own. So you have to install git on every development machine.

I haven't used SVN or other system before so don't exactly know how they work but for git the basic things you do is:
Start a Project
initiate the git for it
write your code
add those files to git
Commit 
Write comment for 'this' commit
and the changes are deposited on local/'your development machine'. Now you have to 'push' those changes  to another repository i.e. another server in case you are doing it on multiple machines

Installation of git on Ubuntu (9.04):
It can be done through 'apt-get install git-core' but that installs the older version. The current version is 1.7.2.3. So download it and install as described below:

Steps:
1. Download git from http://kernel.org/pub/software/scm/git/git-1.7.2.3.tar.gz
2. Unzip the above download
3. cd to unziped directory
4. do
sudo ./configure
Will probably happen successfully :)
5. then do 
sudo make
This should o/p the lines below :)

    CC fast-import.o
    CC abspath.o
    CC advice.o
    CC alias.o
    CC alloc.o
    CC archive.o
    CC archive-tar.o
    CC archive-zip.o
    CC attr.o
    CC base85.o
....
....
...


This shows everything is okay,
if that is not the O/p follow the suggestion given by the installation script might be something is missing probably, xlib1g-dev, do it as below 

sudo apt-get install zlib1g-dev
And redo
sudo make

6. then do
 sudo make install
Some thing like
    INSTALL 644 tclIndex
    INSTALL 644 about.tcl
    INSTALL 644 blame.tcl
    INSTALL 644 branch_checkout.tcl
    INSTALL 644 branch_create.tcl
    INSTALL 644 branch_delete.tcl
    INSTALL 644 branch_rename.tcl
    INSTALL 644 branch.tcl
    INSTALL 644 browser.tcl
    INSTALL 644 checkout_op.tcl
    INSTALL 644 choose_font.tcl
    INSTALL 644 choose_repository.tcl
    INSTALL 644 choose_rev.tcl

shows you have to relax now, git is successfully being installed..

And that's it.

Using GIT:

1) Now create a project or go to your project directory  Ex. mkdir newpro and CD newpro and write your file now or those might already be present if it's old project
2) do initiate the git for it by  git init
3) add all the files from project to  git i.e. by git add .
4) and now commit the changes or in new project case initial commit by git commit
 you will be taken to a file where you can enter a comment so that you remember what was the reason for commit, like in this case we can say "Initial commit"
Then our git repository is perfectly ready.

Now you are free to do changes to  your files and save them as we usually do.
Now add the changed files to git by
git add nameofchnagedfile
and then commit
git commit

other typical uses are well documented here: http://www.spheredev.org/wiki/Git_for_the_lazy , http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#manipulating-branches ,   and one can be more comfortable  with them as he start using it.

To do it on different machines say m1 and m2, first we install git on both machines. Say m1 is central repository and initially our project is there, what we do is initiate git for that project (on m1) and get a clone of it as below (described here: http://danielmiessler.com/blog/using-git-to-maintain-your-website)

cd newpro
git init
git add .
git commit


and then come out of our directory i.e

cd ..
and then clone it
git clone newpro/  newpro.git

so the repository clone is ready on m1

now let's go to m2 and get the clone there and work on it and as you do changes push them to m1 and pull the recent code from the same. Haven't tried this yet, will post it times later.

Comments

Popular posts from this blog

Publishing business basics

Basic Steps: 1. Decide name for the company 2. Register the company with ministry - you will need an attorney (Lawyer for that) 3. Register with Registrar of News Papers in India if it's a magazine/News paper.  4. Study the relevant acts in general or get them known from the lawyer 5. Start publishing Following are details regarding the same (not that well written) : ----- Some starts and books; * Start Your Own Self-Publishing Business (Entrepreneur Magazine's Start Up) by Entrepreneur Press  * How To Start And Run A Small Book Publishing Company: A Small Business Guide To Self-Publishing And Independent Publishing by Peter I. Hupalo  * Art & Science Of Book Publishing by Herbert S., Jr. Bailey  * This Business of Books: A Complete Overview of the Industry from Concept Through Sales by Claudia Suzanne Raja Rammohun Roy National Agency for ISBN West Block-I, Wing-6, 2nd Floor, Sector -I, R.K. Puram, New Delhi-110066 Some new things and the initiatives in the

ती अशीच त्याला भेटली, अगदी अचानक आलेल्या पावसासारखी

खूप पावसाळे गेले. पण अगदी अलीकडे पर्यंत त्याला पाऊस कधीच आवडलेला नव्हता. पाऊस म्हंटल की त्याला भीती वाटायची, नसती कट कट वाटायची. भिजणे तर त्याला कधीच नको वाटायचे, उगाच सर्दी ला आमंत्रण. पण मागच्या पवसाळ्यात ढग असे आले आणि पाऊस इतका पडला की तो पावसाच्या प्रेमातच पडला. पाऊस आधीही पडायचा, कदाचित असाच, इतकाच किंवा जास्त ही. पण या वेळेस मात्र पाऊस एकटा आला नाही, त्याच्या आयुष्यात सोबत घेऊन आला तिच्या केसांचा ओला सुगंध. ती अशीच त्याला भेटली, अगदी अचानक आलेल्या मुंबईतल्या पावसासारखी, चिंब भिजलेली. त्याला ती आवडली आणि म्हणून पाऊस ही. ती त्याला पुन्हा भेटली, न ठरवून, अशीच पुन्हा एकदा अचानक पावसाराखीच. ते बोलले, थांबले, विसावले. ती समोर आली तेंव्हा पाऊस नव्हताच, ती अजून थोडी जवळ आली तेंव्हा ही पाऊस नव्हता. तो तिच्याकडे सारखा पहातच होता, पण नजर चोरून. आयुष्यात पहिल्यांदा त्याने पावसाकडे येण्याची विनवणी केली. आशेच्या नजरेने त्याने ढगांकडे पाहिले. ढग होते, पण अजून पाऊस मात्र नव्हता. तरी ही आजूबाजूंच्या झाडात, डोंगरात, फुलात आणि पाखरात ओलावा होताच. त्याच्या विनवनीने अखेर तो आला. रिम-झिम, रिम-झिम. दो

Do you want to understand all the new technologies and ideas?

 Do you want to understand all the new technologies and ideas? It can be easier than thought. If we look at the past, everything we, the humans created is inspired from nature. Travel across the space is something different, but most other phenomenon existed in nature. Be it fire 🔥, electricity ⚡, wheels 🛞, even intelligence 🧠 which inspired Artificial Intelligence already existed and exists in nature. What we invented is not fire, but a method to ignite the fire when we need it. The same has happened with most of the things. So your e-commerce, digital experience or any futuristic idea must be a replica of something that already exists in physical-world. E-commerce is nothing but a human-made-fire version of commerce that has been existing in the physical-world since ages. No. I don't want to focus here on e-commerce. Be it Web3, Semantic web, Metaverse, Artificial Intelligence, Crypto Currency they are supposed go the way their physical-world phenomenon have gone. This is