Git: Difference between revisions

From VideoLAN Wiki
Jump to navigation Jump to search
More info
m Spelling fixes, and printing shell command fix.
Line 4: Line 4:


== Prepare a local branch to work on ==
== Prepare a local branch to work on ==
  git branch master
  $ git branch master


== List the local branch ==
== List the local branch ==
You can now list your local branch by doing
You can now list your local branch by doing
  git branch
  $ git branch
which should ouput
which should ouput
$ git branch
  * master
  * master


== Commit ==
== 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 '''localy''' your work by
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
  $ git commit -a
or
or
  git commit <specific files>
  $ git commit <specific files>


== Keeping your local working branch in sync ==
== Keeping your local working branch in sync ==
  git fetch origin
  $ git fetch origin
  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 ==
If you want to work on a specific project that could require a branch of the trunk
If you want to work on a specific project that could require a branch of the trunk
  git branch mywork
  $ git branch mywork
to actually use it
to actually use it
  git checkout mywork
  $ git checkout mywork
Then do some commit on it
Then do some commit on it
  git checkout master
  $ git checkout master
to go back to your normal branch
to go back to your normal branch



Revision as of 20:38, 12 April 2007

Getting VLC source code via Git

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

You can also browse the source via gitweb.

Prepare a local branch to work on

$ git branch master

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

$ git branch mywork

to actually use it

$ git checkout mywork

Then do some commit on it

$ git checkout master

to go back to your normal branch


Documentation about git