Difference between revisions of "Git"

From VideoLAN Wiki
Jump to navigation Jump to search
m
m
Line 2: Line 2:
 
  git clone git://git.videolan.org/vlc.git
 
  git clone git://git.videolan.org/vlc.git
 
You can also browse the sources via [http://git.videolan.org/cgi-bin/gitweb.cgi gitweb].
 
You can also browse the sources via [http://git.videolan.org/cgi-bin/gitweb.cgi gitweb].
 +
  
 
== Configure your local git repository ==
 
== Configure your local git repository ==
Line 7: Line 8:
 
  $ git repo-config user.name "Your Name"
 
  $ git repo-config user.name "Your Name"
 
  $ git repo-config user.email "me@example.com"
 
  $ git repo-config user.email "me@example.com"
 +
  
 
== List the local branch ==
 
== List the local branch ==
Line 14: Line 16:
 
  $ git branch
 
  $ git branch
 
  * master
 
  * master
 +
  
 
== Commit ==
 
== Commit ==
Line 20: Line 23:
 
or
 
or
 
  $ git commit <specific files>
 
  $ git commit <specific files>
 +
  
 
== Keeping your local working branch in sync ==
 
== Keeping your local working branch in sync ==
Line 25: Line 29:
 
  $ git rebase origin
 
  $ git rebase origin
 
voilà! Your commit will be re-applied on top of the origin (the svn trunk).
 
voilà! Your commit will be re-applied on top of the origin (the svn trunk).
 +
  
 
== Creating a secondary local branch ==
 
== Creating a secondary local branch ==
Line 43: Line 48:
 
  $ git format-patch --stdout --attach -n origin | git-imap-send
 
  $ git format-patch --stdout --attach -n origin | git-imap-send
 
which will directly produces the emails and store them in a imap mail box, provided that you have properly set up [http://www.kernel.org/pub/software/scm/git/docs/git-imap-send.html git-imap-send].
 
which will directly produces the emails and store them in a imap mail box, provided that you have properly set up [http://www.kernel.org/pub/software/scm/git/docs/git-imap-send.html git-imap-send].
 +
  
 
== Documentation about git ==
 
== Documentation about git ==
 
* [http://git.or.cz/ Official Git Website]
 
* [http://git.or.cz/ Official Git Website]
 
* [http://www.kernel.org/pub/software/scm/git/docs/tutorial.html Git Tutorial]
 
* [http://www.kernel.org/pub/software/scm/git/docs/tutorial.html Git Tutorial]

Revision as of 20:48, 12 April 2007

Getting VLC source code via Git

git clone git://git.videolan.org/vlc.git

You can also browse the sources via gitweb.


Configure your local git repository

Tell git your name. (used by mostly by git-commit)

$ git repo-config user.name "Your Name"
$ git repo-config user.email "me@example.com"


List the local branch

You can now list your local branch by doing

$ git branch

which should ouput

$ git branch
* master


Commit

Now you can start to work on your tree. As soon as you feel you've reached a step in developement you can commit locally your work by

$ git commit -a

or

$ git commit <specific files>


Keeping your local working branch in sync

$ git fetch origin
$ git rebase origin

voilà! Your commit will be re-applied on top of the origin (the svn trunk).


Creating a secondary local branch

If you want to work on a specific project that could require a branch of the trunk, create a local branch of the current branch by doing:

$ git branch mywork

and to actually use it do:

$ git checkout mywork

Then do some commit on it... And you can go back to your original master branch by doing:

$ git checkout master


Submitting patches to the vlc-devel

If you have been developing on vlc locally and (still) don't have write access, you can submit all your commit in one shot using:

$ git format-patch -o out origin

which will produce the patches for each local commit in the directory "out". You can also use the git-imap-send command:

$ git format-patch --stdout --attach -n origin | git-imap-send

which will directly produces the emails and store them in a imap mail box, provided that you have properly set up git-imap-send.


Documentation about git