<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DozyB</id>
	<title>VideoLAN Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DozyB"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/DozyB/"/>
	<updated>2026-11-04T15:52:53Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Git&amp;diff=30003</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Git&amp;diff=30003"/>
		<updated>2015-05-20T21:24:07Z</updated>

		<summary type="html">&lt;p&gt;DozyB: Updating stable-branch git link, to 2.2. Now matches https://wiki.videolan.org/GetTheSource/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://git-scm.com/ Git] is a free and open source [[wikipedia:Revision_control|version control system]]. It is used by programmers to keep track of the different versions of the files composing a software.&lt;br /&gt;
&lt;br /&gt;
= Basic Git usage =&lt;br /&gt;
&lt;br /&gt;
If you are using &#039;&#039;&#039;Windows&#039;&#039;&#039;, please read the [[Git_Windows]] page.&lt;br /&gt;
&lt;br /&gt;
== Getting VLC or x264 source code via Git ==&lt;br /&gt;
 &lt;br /&gt;
 $ git clone git://git.videolan.org/vlc.git&lt;br /&gt;
Voilà! The full VLC history should be on your hard disk in vlc/.&lt;br /&gt;
&lt;br /&gt;
 $ git clone git://git.videolan.org/x264.git&lt;br /&gt;
Voilà! The full x264 history should be on your hard disk in x264/.&lt;br /&gt;
&lt;br /&gt;
If you want only the last 3 VLC revisions:&lt;br /&gt;
 $ git clone git://git.videolan.org/vlc.git --depth 3&lt;br /&gt;
&lt;br /&gt;
Clones without the full revision set (--depth) can&#039;t be used for backporting (or to make sure that you&#039;re including at least commits up to the common fork point).&lt;br /&gt;
&lt;br /&gt;
You can also have the VLC stable branch, here:&lt;br /&gt;
 $ git clone git://git.videolan.org/vlc/vlc-2.2.git&lt;br /&gt;
Voilà! You got the stable branch repository.&lt;br /&gt;
&lt;br /&gt;
Or via http protocol from the main site:&lt;br /&gt;
$ git clone http://git.videolan.org/git/vlc.git&lt;br /&gt;
See http://git.videolan.org/?p=vlc.git;a=summary&lt;br /&gt;
&lt;br /&gt;
Or via http protocol from github (github can sometimes be a bit behind as a mirror):&lt;br /&gt;
https://github.com/videolan/vlc.git&lt;br /&gt;
See https://github.com/videolan/vlc&lt;br /&gt;
&lt;br /&gt;
You can also clone using http via our repo.or.cz mirror.&lt;br /&gt;
 $ git clone http://repo.or.cz/r/vlc.git&lt;br /&gt;
See http://repo.or.cz/w/vlc.git (a mirror).&lt;br /&gt;
&lt;br /&gt;
=== After cloning ===&lt;br /&gt;
&lt;br /&gt;
 $ git log&lt;br /&gt;
to see the full log of the trunk.&lt;br /&gt;
 $ gitk&lt;br /&gt;
to see the log graphically.&lt;br /&gt;
&lt;br /&gt;
You can also browse the sources via [http://git.videolan.org/ gitweb].&lt;br /&gt;
&lt;br /&gt;
== Configure your global git config ==&lt;br /&gt;
May need to use &lt;br /&gt;
$ git repo-config {various options} &lt;br /&gt;
1.4.4.2 Requires the repo-config command rather than just config&lt;br /&gt;
&lt;br /&gt;
=== Personal Information ===&lt;br /&gt;
Tell git your name. (use mostly by git-commit)&lt;br /&gt;
 $ git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
 $ git config --global user.email &amp;quot;me@example.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Mail Setup ===&lt;br /&gt;
To send patches you&#039;ll need a working git-send-email configuration. &lt;br /&gt;
====Built-in SMTP support (easiest)====&lt;br /&gt;
&#039;&#039;git-send-email&#039;&#039; has built in support for sending e-mail through SMTP. You&#039;ll need a command line similar to the following one:&lt;br /&gt;
&lt;br /&gt;
 git-send-email --annotate --smtp-server=smtp.example.com --smtp-server-port=587 --smtp-encryption=tls --smtp-user=&amp;quot;yourname@example.com&amp;quot; &amp;lt;...&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====MSMTP====&lt;br /&gt;
You can use [http://msmtp.sourceforge.net/ msmtp] to achieve this. Install it with tls and ssl activated and place the following config file (.msmtprc) in your home directory&lt;br /&gt;
 # msmtp configuration file&lt;br /&gt;
 &lt;br /&gt;
 # Set default values for all following accounts.&lt;br /&gt;
 defaults&lt;br /&gt;
 tls on&lt;br /&gt;
 tls_starttls on&lt;br /&gt;
 tls_trust_file /certificates/EquifaxSecureCertificateAuthority.crt&lt;br /&gt;
 logfile /log/.msmtp.log&lt;br /&gt;
 &lt;br /&gt;
 # GMAIL&lt;br /&gt;
 account gmail&lt;br /&gt;
 host smtp.gmail.com&lt;br /&gt;
 port 587&lt;br /&gt;
 protocol smtp&lt;br /&gt;
 from user.name@gmail.com&lt;br /&gt;
 auth on&lt;br /&gt;
 user user.name@gmail.com&lt;br /&gt;
 &lt;br /&gt;
 # Set a default account&lt;br /&gt;
 account default : gmail&lt;br /&gt;
Then configure git to use msmtp. The password will be asked for upon sending mail.&lt;br /&gt;
 $ git config --global sendemail.smtpserver /usr/local/bin/msmtp&lt;br /&gt;
The certificate for gmail can be found here: [http://www.geotrust.com/resources/extended-validation-ssl/certs/Equifax%20Secure%20Certificate%20Authority.crt EquifaxSecureCertificateAuthority.crt]&lt;br /&gt;
&lt;br /&gt;
If you receive a &#039;&#039;&#039;cannot set X509 trust file&#039;&#039;&#039; error when using another CA certificate, make sure it is in the PEM (text format) rather than DER format (binary).&lt;br /&gt;
&lt;br /&gt;
====Mac OS X====&lt;br /&gt;
&lt;br /&gt;
Setup info with e.g. gmail account&lt;br /&gt;
 $ git config --global sendemail.smtpserver smtp.gmail.com&lt;br /&gt;
 $ git config --global sendemail.smtpuser your-gmail-address-here&lt;br /&gt;
 $ git config --global sendemail.smtpencryption tls&lt;br /&gt;
 $ git config --global sendemail.smtpserverport 587&lt;br /&gt;
&lt;br /&gt;
If errors occur telling you something like perl&#039;s SMTP::SSL package is not there. Do the following&lt;br /&gt;
 $ sudo -H cpan Net::SMTP::SSL&lt;br /&gt;
&lt;br /&gt;
=== Using git with color (Tip) ===&lt;br /&gt;
If you want to use git with colored output use:&lt;br /&gt;
 $ git config --global color.ui true&lt;br /&gt;
&lt;br /&gt;
If you are using an old git version (prior to 1.5.5) and previous command didn&#039;t work, use:&lt;br /&gt;
 $ git config --global color.diff auto&lt;br /&gt;
 $ git config --global color.status auto&lt;br /&gt;
 $ git config --global color.branch auto&lt;br /&gt;
&lt;br /&gt;
=== Setting up &amp;quot;git up&amp;quot; (Tip) ===&lt;br /&gt;
If you want to be able to just keep in sync using &amp;quot;git up&amp;quot; use:&lt;br /&gt;
 $ git config --global alias.up &amp;quot;pull --rebase&amp;quot;&lt;br /&gt;
And if you like your tree to be messy and don&#039;t want git to complain (like in svn) use:&lt;br /&gt;
 $ git config --global alias.up &#039;!sh -c &amp;quot;git commit -a -m &amp;quot;Before rebase&amp;quot; &amp;amp;&amp;amp; git pull --rebase &amp;amp;&amp;amp; git reset head^&amp;quot;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Setting up &amp;quot;git wu&amp;quot; (Git What&#039;s Up) (Tip) ===&lt;br /&gt;
If you want to see what you are about to &amp;quot;git push&amp;quot;:&lt;br /&gt;
 $ git config --global alias.wu &amp;quot;log --stat origin..@{0}&amp;quot;&lt;br /&gt;
Now use:&lt;br /&gt;
 $ git wu&lt;br /&gt;
Note that this only works for the master branch.&lt;br /&gt;
&lt;br /&gt;
=== Setting up &amp;quot;git wup&amp;quot; (Git What&#039;s Up - with patch) (Tip) ===&lt;br /&gt;
If you want to see what you are about to &amp;quot;git push&amp;quot;, along with the diff:&lt;br /&gt;
 $ git config --global alias.wup &amp;quot;log -p origin..@{0}&amp;quot;&lt;br /&gt;
Now use:&lt;br /&gt;
 $ git wup&lt;br /&gt;
&lt;br /&gt;
== Set up Hooks (Tip) ==&lt;br /&gt;
If you are using Qt-creator and want to keep your files listing in sync,&lt;br /&gt;
just set up a post-checkout hook accordingly.&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # this file as .git/hooks/post-checkout&lt;br /&gt;
 if test -f vlc.files&lt;br /&gt;
 then&lt;br /&gt;
        echo &amp;quot;Updating Qt files list&amp;quot;&lt;br /&gt;
        git ls-files &amp;gt; vlc.files&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
== General GIT Workflow ==&lt;br /&gt;
1.  Make your file edits in your local repository.&lt;br /&gt;
&lt;br /&gt;
2.  &amp;quot;git commit&amp;quot;      the changes in your local repository&lt;br /&gt;
&lt;br /&gt;
3.  &amp;quot;git pull --rebase&amp;quot;  or &amp;quot;git up&amp;quot; (if you did &#039;&#039;git config --global alias.up &amp;quot;pull --rebase&amp;quot;&#039;&#039;) to bring the rest of your local repository up to date&lt;br /&gt;
&lt;br /&gt;
4.  &amp;quot;git log origin..master&amp;quot;    to check what you are going to commit&lt;br /&gt;
&lt;br /&gt;
4.  &amp;quot;git push&amp;quot;    to move your changes up to the master&lt;br /&gt;
&lt;br /&gt;
&amp;quot;git stash&amp;quot;    if you want to &amp;quot;hide&amp;quot; your changes.  Do this if you think there may be other commits against the same things you are working on and want to refresh your local checkout (using a git pull --rebase) from the master. Use &amp;quot;git stash apply&amp;quot; to get your stash back. &lt;br /&gt;
&lt;br /&gt;
&amp;quot;git checkout -f master&amp;quot;     if you think your tree is pretty hopeless, need a kill-and-fill to bring the master into your local repository.&lt;br /&gt;
&lt;br /&gt;
== List the local branch ==&lt;br /&gt;
You can now list your local branch by doing&lt;br /&gt;
 $ git branch&lt;br /&gt;
which should output&lt;br /&gt;
 $ git branch&lt;br /&gt;
 * master&lt;br /&gt;
&lt;br /&gt;
== List your local non committed changes ==&lt;br /&gt;
 $ git status | less&lt;br /&gt;
&lt;br /&gt;
== Commit ==&lt;br /&gt;
Now you can start to work on your tree. As soon as you feel you have reached a step in development where you can commit your work &#039;&#039;&#039;locally&#039;&#039;&#039;, use&lt;br /&gt;
 $ git commit -a&lt;br /&gt;
or&lt;br /&gt;
 $ git commit &amp;lt;specific files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wish to give credit to someone else&#039;s work (e.g. you are applying a third party patch):&lt;br /&gt;
 $ git commit &amp;lt;specific files&amp;gt; --author &amp;quot;Name Surname &amp;lt;user@domain.com&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== List your commits ==&lt;br /&gt;
 $ git log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Keeping your local working branch in sync ==&lt;br /&gt;
 $ git pull --rebase&lt;br /&gt;
&lt;br /&gt;
To shorten up that command type&lt;br /&gt;
 $ git config --global alias.up &amp;quot;pull --rebase&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now you can just type:&lt;br /&gt;
 $ git up&lt;br /&gt;
&lt;br /&gt;
== Use a graphical interface ==&lt;br /&gt;
 $ gitk          # Tree Browser&lt;br /&gt;
 $ qgit          # Tree Browser&lt;br /&gt;
 $ git-gui       # Commit/push/... editor&lt;br /&gt;
&lt;br /&gt;
= Submitting patches =&lt;br /&gt;
&lt;br /&gt;
First make sure you have &#039;&#039;&#039;read&#039;&#039;&#039; our [[Sending Patches]] page. And that you&#039;ve &#039;&#039;&#039;read&#039;&#039;&#039; the [[Sending Patches#Check_List| Check List]].&lt;br /&gt;
&lt;br /&gt;
If you have been developing on vlc locally and (still) don&#039;t have write access, you can submit all your commits in one shot using:&lt;br /&gt;
 $ rm -Rf patches&lt;br /&gt;
 $ git format-patch -o patches origin&lt;br /&gt;
 $ git send-email --to vlc-devel@videolan.org patches&lt;br /&gt;
If you want to create a cover letter for multiple patches use:&lt;br /&gt;
 $ git format-patch -o patches origin -n --cover-letter&lt;br /&gt;
 $ git send-email --annotate --cover-letter --to vlc-devel@videolan.org patches&lt;br /&gt;
If you have multiple patch consider using:&lt;br /&gt;
 $ git send-email --compose --no-chain-reply-to --to vlc-devel@videolan.org patches&lt;br /&gt;
This will produce the patches for each local commit in the directory &amp;quot;patches&amp;quot; and send them.&lt;br /&gt;
Use --no-chain-reply-to make sure it doesn&#039;t reply.&lt;br /&gt;
&lt;br /&gt;
For x264, do the same with x264-devel@videolan.org&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- what does the following mean? --&amp;gt;&lt;br /&gt;
Don&#039;t do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
*** [PATCH 2/m]&lt;br /&gt;
**** ...&lt;br /&gt;
But do:&lt;br /&gt;
* [PATCH 0/m]&lt;br /&gt;
** [PATCH 1/m]&lt;br /&gt;
** [PATCH 2/m]&lt;br /&gt;
** ..&lt;br /&gt;
&lt;br /&gt;
= Advanced usage =&lt;br /&gt;
== Creating a secondary local branch ==&lt;br /&gt;
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:&lt;br /&gt;
 $ git branch mywork&lt;br /&gt;
and to actually use it do:&lt;br /&gt;
 $ git checkout mywork&lt;br /&gt;
Which could be summarized by:&lt;br /&gt;
 $ git checkout -b mywork&lt;br /&gt;
&lt;br /&gt;
Then do some commit on it... And you can go back to your original master branch by doing:&lt;br /&gt;
 $ git checkout master&lt;br /&gt;
&lt;br /&gt;
== Fetching a remote branch ==&lt;br /&gt;
To see the remote branch use:&lt;br /&gt;
 $ git branch -r&lt;br /&gt;
If the remote branch is named 0.8.6-bugfix&lt;br /&gt;
 $ git branch 0.8.6-bugfix origin/0.8.6-bugfix &lt;br /&gt;
 Branch 0.8.6-bugfix set up to track remote branch refs/remotes/origin/0.8.6-bugfix.&lt;br /&gt;
 $ git branch&lt;br /&gt;
  0.8.6-bugfix&lt;br /&gt;
  * master&lt;br /&gt;
To checkout that branch use:&lt;br /&gt;
 $ git checkout 0.8.6-bugfix&lt;br /&gt;
To stay up-to-date a simple&lt;br /&gt;
 $ git pull --rebase&lt;br /&gt;
Should be enough.&lt;br /&gt;
&lt;br /&gt;
If warnings appear that files still need updating:&lt;br /&gt;
 $ include/libvlc_internal.h: needs update&lt;br /&gt;
   include/mediacontrol_internal.h: needs update&lt;br /&gt;
   include/vlc/libvlc.h: needs update&lt;br /&gt;
   include/vlc_update.h: needs update&lt;br /&gt;
   modules/access/mms/mms.c: needs update&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
Then do a checkout -f to revert non committed local changes&lt;br /&gt;
 $ git checkout -f&lt;br /&gt;
&lt;br /&gt;
To stay up-to-date another&lt;br /&gt;
 $ git pull --rebase&lt;br /&gt;
Should give no more warnings.&lt;br /&gt;
&lt;br /&gt;
To push to the remote branch, use:&lt;br /&gt;
 $git push origin 0.8.6-bugfix:0.8.6-bugfix&lt;br /&gt;
&lt;br /&gt;
== Creating a remote branch ==&lt;br /&gt;
If the new remote branch is named 0.9.0-bugfix, and is based on the local master branch.&lt;br /&gt;
First make sure everything go as planned with the --dry-run option:&lt;br /&gt;
 $ git push --dry-run origin master:refs/heads/0.9.0-stable&lt;br /&gt;
 To git@git.videolan.org:vlc.git&lt;br /&gt;
 * [new branch]      master -&amp;gt; 0.9.0-stable&lt;br /&gt;
&lt;br /&gt;
Then push it:&lt;br /&gt;
 $ git push origin master:refs/heads/0.9.0-stable&lt;br /&gt;
 To git@git.videolan.org:vlc.git&lt;br /&gt;
 * [new branch]      master -&amp;gt; 0.9.0-stable&lt;br /&gt;
 $ git branch -r&lt;br /&gt;
  origin/0.9.0-stable&lt;br /&gt;
  origin/master&lt;br /&gt;
&lt;br /&gt;
To checkout that branch now see &#039;&#039;Fetching a remote branch&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Backporting commits ==&lt;br /&gt;
It is possible to &amp;quot;backport&amp;quot; commit between the master branch and a -bugfix branch. However since VDD&#039;09, the bugfix branches have been split to their own git repositories. This leaves us with 2 cases.&lt;br /&gt;
&lt;br /&gt;
=== Normal simple case ===&lt;br /&gt;
&lt;br /&gt;
Go to your -bugfix branch:&lt;br /&gt;
 $ git checkout 1.0-bugfix&lt;br /&gt;
&lt;br /&gt;
Backport the commit: &lt;br /&gt;
 $ git cherry-pick -x -s &amp;lt;sha-id of commit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If git fails to do the backport by itself, you&#039;ll be presented with the usual options in case of a failed merge or patching. Use &amp;quot;git status&amp;quot;, your favorite editor or &amp;quot;git mergetool&amp;quot; to resolve the situation. Then use &amp;quot;git add&amp;quot; and &amp;quot;git commit -c &amp;lt;sha-id of backported commit&amp;gt;&amp;quot;.&lt;br /&gt;
Then push your commit as usual.&lt;br /&gt;
&lt;br /&gt;
=== Case of VLC bugfix branches ===&lt;br /&gt;
Due to the number of commits in vlc.git and the amount of divergence between the master and 1.0-bugfix branches, they have been separated into two different git repositories. But that doesn&#039;t block you from backporting.&lt;br /&gt;
&lt;br /&gt;
Get the -bugfix git:&lt;br /&gt;
 $ git clone git://git.videolan.org/vlc/vlc-1.0.git vlc-bugfix&lt;br /&gt;
Add vlc.git as an additional remote:&lt;br /&gt;
 $ git remote add vlc-master git://git.videolan.org/vlc.git&lt;br /&gt;
Update the information from vlc-master&lt;br /&gt;
 $ git fetch vlc-master&lt;br /&gt;
Backport as normal&lt;br /&gt;
 $ git cherry-pick -x -s &amp;lt;sha-id of commit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Publishing your own fork ==&lt;br /&gt;
Go to [http://repo.or.cz/w/vlc.git http://repo.or.cz/w/vlc.git] and click [http://repo.or.cz/regproj.cgi?fork=vlc.git fork]. You will be able to publish your work there.&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t forget to send a mail to the &#039;&#039;vlc-devel&#039;&#039; mailing list as soon as you create your fork.&lt;br /&gt;
&lt;br /&gt;
== Revert your non-committed local changes ==&lt;br /&gt;
 $ git checkout -f&lt;br /&gt;
&lt;br /&gt;
==Edit or undo not yet pushed commits ==&lt;br /&gt;
This will undo the last commit&lt;br /&gt;
 $ git reset HEAD^&lt;br /&gt;
which is the same as&lt;br /&gt;
 $ git reset master^&lt;br /&gt;
(if your checked-out copy of your tree is master)&lt;br /&gt;
And also the same as&lt;br /&gt;
 $ git reset a44a594 # note that there is no need to use the full sha id&lt;br /&gt;
&lt;br /&gt;
If you have a stack of patch that you have not yet committed you can delete one patch from the list using git rebase --interactive&lt;br /&gt;
 $ git rebase --interactive origin&lt;br /&gt;
  pick eacf185 test&lt;br /&gt;
  pick 56322eb VLMA owner is vlma prod.&lt;br /&gt;
 &lt;br /&gt;
  # Rebase 826757e..56322eb onto 826757e&lt;br /&gt;
  #&lt;br /&gt;
  # Commands:&lt;br /&gt;
  #  pick = use commit&lt;br /&gt;
  #  edit = use commit, but stop for amending&lt;br /&gt;
  #  squash = use commit, but meld into previous commit&lt;br /&gt;
&lt;br /&gt;
== Diff-ing ==&lt;br /&gt;
* You can diff between two branches using&lt;br /&gt;
 $ git diff branch1 branch2&lt;br /&gt;
* You can diff between the previous 10th commit and current using&lt;br /&gt;
 $ git diff HEAD~10 HEAD&lt;br /&gt;
* You can diff between the previous 10th commit and current of the branch &amp;quot;mywork&amp;quot; using&lt;br /&gt;
 $ git diff mywork~10 mywork&lt;br /&gt;
* Imagine that git log is like&lt;br /&gt;
 $ git log&lt;br /&gt;
 commit e0394f269305edd09843257e7c1d1a66aaf48ab3&lt;br /&gt;
 Author: jb &amp;lt;jb&amp;gt;&lt;br /&gt;
 Date:   Fri Apr 13 07:14:48 2007 +0000&lt;br /&gt;
    qt4 - Mousewheel (2)&lt;br /&gt;
 commit e80b339081aa6755f67c9bd8e2aacf93a9a79d95&lt;br /&gt;
 [..]&lt;br /&gt;
 commit ff7004b70fd239e4120deb160e2991bd5237b8df&lt;br /&gt;
 [..]&lt;br /&gt;
 commit a44a594898f981a145cfcace5f16f8973f9eb46f&lt;br /&gt;
 [..]&lt;br /&gt;
 commit 690df705c963cf6bf6f5746d54bc97a85ff91919&lt;br /&gt;
 [..]&lt;br /&gt;
 commit 679f8b1c3e0baa469efa970588b95a625c595d64&lt;br /&gt;
 [..]&lt;br /&gt;
&lt;br /&gt;
 $ git diff a44a594898f981a145cfcace5f16f8973f9eb46f~2 e80b339081aa6755f67c9bd8e2aacf93a9a79d95&lt;br /&gt;
Will be equivalent to:&lt;br /&gt;
 $ git diff ff7004b70fd239e4120deb160e2991bd5237b8df e80b339081aa6755f67c9bd8e2aacf93a9a79d95&lt;br /&gt;
And to:&lt;br /&gt;
 $ git diff HEAD~4 HEAD^&lt;br /&gt;
&lt;br /&gt;
* Remember that to produce a patch you should rather use git format-patch than git diff most of the time.&lt;br /&gt;
&lt;br /&gt;
== Patch-ing ==&lt;br /&gt;
* You can apply patches using&lt;br /&gt;
 $ git apply &amp;lt;patch&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tracking regression ==&lt;br /&gt;
git has a great tool called [http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html git-bisect] to help you to track a faulty commit. Imagine you are tracking a bug that is known to appear after 0.8.6 (assuming 0.8.6 is tagged):&lt;br /&gt;
 $ git bisect start&lt;br /&gt;
 $ git bisect bad # tell git current version has the bug you are tracking&lt;br /&gt;
 $ git bisect good 0.8.6 # tell git 0.8.6 didn&#039;t have the bug&lt;br /&gt;
And then git will checkout a certain revision, and ask you to test it. And you simply say whether this version has the bug.&lt;br /&gt;
If it has the bug:&lt;br /&gt;
 $ git bisect bad&lt;br /&gt;
if the bug is not present:&lt;br /&gt;
 $ git bisect good&lt;br /&gt;
And so on by bisection... At the end git will indicate the faulty commit. Most of the time this tool is really efficient to track regression.&lt;br /&gt;
&lt;br /&gt;
If you can provide a script that test the presence of the bug &lt;br /&gt;
 $ git bisect run &amp;lt;script_name&amp;gt;&lt;br /&gt;
will be able to track down the regression by itself. See [http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html git-bisect Documentation].&lt;br /&gt;
&lt;br /&gt;
= Using Git to push to VideoLAN git =&lt;br /&gt;
== Initial requirements ==&lt;br /&gt;
* You must have credentials to push commits into the repository. For other contributors, please read upper [[Git#Submitting_patches_to_the_vlc-devel_or_x264-devel|Submitting patches to the vlc-devel or x264-devel]] paragraph.&lt;br /&gt;
* Make sure you&#039;ve set your name and email in your commits&lt;br /&gt;
 $ git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
 $ git config --global user.email &amp;quot;me@example.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Convert your tree to use your ssh push commit access ==&lt;br /&gt;
 $ vi vlc/.git/config&lt;br /&gt;
And replace&lt;br /&gt;
 git://git.videolan.org/vlc.git&lt;br /&gt;
With&lt;br /&gt;
 git@git.videolan.org:vlc.git&lt;br /&gt;
&lt;br /&gt;
== Staying up to date ==&lt;br /&gt;
  $ git pull --rebase&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to have to type --rebase every time you pull do:&lt;br /&gt;
 $ git config branch.master.rebase true&lt;br /&gt;
&lt;br /&gt;
This one creates a merge object which is not how SVN worked, so let&#039;s use the first version...&lt;br /&gt;
  $ git pull&lt;br /&gt;
&lt;br /&gt;
== Pushing your work ==&lt;br /&gt;
  $ git log origin..master     # Check what you are going to push&lt;br /&gt;
  $ git push&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- GSoC 2007&lt;br /&gt;
= Using Git to publish your work (for SoC student?) =&lt;br /&gt;
First get the official VLC &#039;&#039;&#039;Soc&#039;&#039;&#039; trunk&lt;br /&gt;
 $ git clone git://git.videolan.org/vlc-soc.git&lt;br /&gt;
 $ cd vlc-soc&lt;br /&gt;
Ask for write access to a branch (called your_name_branch). Now we will make git know that you want to publish on this branch&lt;br /&gt;
 $ git config remote.my_soc_public_branch.url ssh://your_name@altair.videolan.org/home/videolan/gitroot/vlc-soc.git&lt;br /&gt;
Now tell git that you want to automatically push the local master branch to the public your_name_branch:&lt;br /&gt;
 $ git config remote.my_soc_public_branch.push +master:your_name_branch # the &amp;quot;+&amp;quot; will tell git to force update ignoring conflicts&lt;br /&gt;
&lt;br /&gt;
Do some work and commit it to your master branch.&lt;br /&gt;
 $ git commit -a&lt;br /&gt;
You can also sync with the trunk (origin) as needed&lt;br /&gt;
 $ git pull --rebase origin&lt;br /&gt;
And don&#039;t forget to publish your changes:&lt;br /&gt;
 $ git push my_soc_public_branch&lt;br /&gt;
Now you should be able to see your latest changes in your branch via [http://git.videolan.org/ gitweb].&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Documentation about git =&lt;br /&gt;
* [http://git-scm.com/ Official Git Website]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/tutorial.html Git Tutorial]&lt;br /&gt;
* [http://git.or.cz/course/svn.html Switching from SVN to git using cogito]&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Very good Git guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding]]&lt;/div&gt;</summary>
		<author><name>DozyB</name></author>
	</entry>
</feed>