firstruby

Master ruby with us

GIT – Fast Version Control System

Posted by firstruby on October 25, 2008

GIT is distributed version control system. Following is a small stuff which may help to use GIT with our applications,

Goto root directory of the application, say my application is ‘demo’.

1. To take the code from GIT server,

bango@bango-desktop:~$ git clone <git-url>

After that, I need to change my directory to ‘/demo’.  To update the code from GIT server,

bango@bango-desktop:~/demo$ git pull

2. Once you complete the functionality, and if you want to commit the code to GIT server, then

bango@bango-desktop:~/demo$ git status

‘git status’ will show you the names of all changed files.

3. To add changed files to GIT server,

bango@bango-desktop:~/demo$ git add <path_of_the_1st_changed_file>
bango@bango-desktop:~/demo$ git add <path_of_the_2nd_changed_file>

like this, add all files.. and if you have many files and if you want to add them at a time, then

bango@bango-desktop:~/demo$ git add .

4. To commit the code to GIT server,

bango@bango-desktop:~/demo$ git commit -m “<your-message-regarding-the-functionality>”

5. To push the code to GIT server,

bango@bango-desktop:~/demo$ git push origin master

You may find more commands here…  http://www.kernel.org/pub/software/scm/git/docs/

I am using GIT with my RubyOnRails applications.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: