Difference between revisions of "Git for dummies"

From FreekiWiki
Jump to navigation Jump to search
(setup)
(use headings)
Line 1: Line 1:
 +
===Setup===
 +
 
Set up your system:
 
Set up your system:
 
   sudo apt-get install git-core
 
   sudo apt-get install git-core
Line 5: Line 7:
  
 
Note that if you are using debian etch, you will need to get a backport of git from backports.org.
 
Note that if you are using debian etch, you will need to get a backport of git from backports.org.
 +
 +
===Getting the repo===
  
 
Get a copy of the ''library'' project (assuming the central repository is on a server named ''devo''):
 
Get a copy of the ''library'' project (assuming the central repository is on a server named ''devo''):
Line 17: Line 21:
 
   git rebase origin/master
 
   git rebase origin/master
 
(Master is like trunk is in svn.)
 
(Master is like trunk is in svn.)
 +
 +
===Making changes===
  
 
Now edit a file
 
Now edit a file

Revision as of 20:20, 15 November 2008

Setup

Set up your system:

 sudo apt-get install git-core
 git config --global user.email somebody@somewhere.tld
 git config --global user.name "John Doe"

Note that if you are using debian etch, you will need to get a backport of git from backports.org.

Getting the repo

Get a copy of the library project (assuming the central repository is on a server named devo):

 git clone devo:/git/library
 cd library/

Sort of like svn update:

 git pull

Like svn update (but if you have local commits):

 git fetch
 git rebase origin/master

(Master is like trunk is in svn.)

Making changes

Now edit a file

 vi TODO 

(See it's just like svn!!)

Now schedule this modification to be committed locally:

 git add TODO 

Want to see changes that you hain't yet git added?

 git diff

Want to see what you are about to commit?

 git diff --cached

Now commit it locally:

 git commit

Now send your locally committed changes to the main repository:

 git push


Git - SVN Crash Course