You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

git-howto.html 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. Using Git to develop FFmpeg
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. Using Git to develop FFmpeg
  17. </h1>
  18. <div align="center">
  19. </div>
  20. <a name="SEC_Top"></a>
  21. <div class="Contents_element" id="SEC_Contents">
  22. <h2 class="contents-heading">Table of Contents</h2>
  23. <div class="contents">
  24. <ul class="no-bullet">
  25. <li><a id="toc-Introduction" href="#Introduction">1 Introduction</a></li>
  26. <li><a id="toc-Basics-Usage" href="#Basics-Usage">2 Basics Usage</a>
  27. <ul class="no-bullet">
  28. <li><a id="toc-Get-Git" href="#Get-Git">2.1 Get Git</a></li>
  29. <li><a id="toc-Cloning-the-source-tree" href="#Cloning-the-source-tree">2.2 Cloning the source tree</a></li>
  30. <li><a id="toc-Updating-the-source-tree-to-the-latest-revision-1" href="#Updating-the-source-tree-to-the-latest-revision-1">2.3 Updating the source tree to the latest revision</a></li>
  31. <li><a id="toc-Rebasing-your-local-branches" href="#Rebasing-your-local-branches">2.4 Rebasing your local branches</a></li>
  32. <li><a id="toc-Adding_002fremoving-files_002fdirectories" href="#Adding_002fremoving-files_002fdirectories">2.5 Adding/removing files/directories</a></li>
  33. <li><a id="toc-Showing-modifications" href="#Showing-modifications">2.6 Showing modifications</a></li>
  34. <li><a id="toc-Inspecting-the-changelog" href="#Inspecting-the-changelog">2.7 Inspecting the changelog</a></li>
  35. <li><a id="toc-Checking-source-tree-status" href="#Checking-source-tree-status">2.8 Checking source tree status</a></li>
  36. <li><a id="toc-Committing" href="#Committing">2.9 Committing</a></li>
  37. <li><a id="toc-Writing-a-commit-message" href="#Writing-a-commit-message">2.10 Writing a commit message</a></li>
  38. <li><a id="toc-Preparing-a-patchset" href="#Preparing-a-patchset">2.11 Preparing a patchset</a></li>
  39. <li><a id="toc-Sending-patches-for-review" href="#Sending-patches-for-review">2.12 Sending patches for review</a></li>
  40. <li><a id="toc-Renaming_002fmoving_002fcopying-files-or-contents-of-files" href="#Renaming_002fmoving_002fcopying-files-or-contents-of-files">2.13 Renaming/moving/copying files or contents of files</a></li>
  41. </ul></li>
  42. <li><a id="toc-Git-configuration" href="#Git-configuration">3 Git configuration</a>
  43. <ul class="no-bullet">
  44. <li><a id="toc-Personal-Git-installation" href="#Personal-Git-installation">3.1 Personal Git installation</a></li>
  45. <li><a id="toc-Repository-configuration" href="#Repository-configuration">3.2 Repository configuration</a></li>
  46. </ul></li>
  47. <li><a id="toc-FFmpeg-specific" href="#FFmpeg-specific">4 FFmpeg specific</a>
  48. <ul class="no-bullet">
  49. <li><a id="toc-Reverting-broken-commits" href="#Reverting-broken-commits">4.1 Reverting broken commits</a></li>
  50. <li><a id="toc-Pushing-changes-to-remote-trees" href="#Pushing-changes-to-remote-trees">4.2 Pushing changes to remote trees</a></li>
  51. <li><a id="toc-Finding-a-specific-svn-revision" href="#Finding-a-specific-svn-revision">4.3 Finding a specific svn revision</a></li>
  52. </ul></li>
  53. <li><a id="toc-gpg-key-generation" href="#gpg-key-generation">5 gpg key generation</a></li>
  54. <li><a id="toc-Pre_002dpush-checklist" href="#Pre_002dpush-checklist">6 Pre-push checklist</a></li>
  55. <li><a id="toc-Server-Issues" href="#Server-Issues">7 Server Issues</a></li>
  56. </ul>
  57. </div>
  58. </div>
  59. <a name="Introduction"></a>
  60. <h2 class="chapter">1 Introduction<span class="pull-right"><a class="anchor hidden-xs" href="#Introduction" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Introduction" aria-hidden="true">TOC</a></span></h2>
  61. <p>This document aims in giving some quick references on a set of useful Git
  62. commands. You should always use the extensive and detailed documentation
  63. provided directly by Git:
  64. </p>
  65. <div class="example">
  66. <pre class="example">git --help
  67. man git
  68. </pre></div>
  69. <p>shows you the available subcommands,
  70. </p>
  71. <div class="example">
  72. <pre class="example">git &lt;command&gt; --help
  73. man git-&lt;command&gt;
  74. </pre></div>
  75. <p>shows information about the subcommand &lt;command&gt;.
  76. </p>
  77. <p>Additional information could be found on the
  78. <a href="http://gitref.org">Git Reference</a> website.
  79. </p>
  80. <p>For more information about the Git project, visit the
  81. <a href="http://git-scm.com/">Git website</a>.
  82. </p>
  83. <p>Consult these resources whenever you have problems, they are quite exhaustive.
  84. </p>
  85. <p>What follows now is a basic introduction to Git and some FFmpeg-specific
  86. guidelines to ease the contribution to the project.
  87. </p>
  88. <a name="Basics-Usage"></a>
  89. <h2 class="chapter">2 Basics Usage<span class="pull-right"><a class="anchor hidden-xs" href="#Basics-Usage" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Basics-Usage" aria-hidden="true">TOC</a></span></h2>
  90. <a name="Get-Git"></a>
  91. <h3 class="section">2.1 Get Git<span class="pull-right"><a class="anchor hidden-xs" href="#Get-Git" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Get-Git" aria-hidden="true">TOC</a></span></h3>
  92. <p>You can get Git from <a href="http://git-scm.com/">http://git-scm.com/</a>
  93. Most distribution and operating system provide a package for it.
  94. </p>
  95. <a name="Cloning-the-source-tree"></a>
  96. <h3 class="section">2.2 Cloning the source tree<span class="pull-right"><a class="anchor hidden-xs" href="#Cloning-the-source-tree" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Cloning-the-source-tree" aria-hidden="true">TOC</a></span></h3>
  97. <div class="example">
  98. <pre class="example">git clone https://git.ffmpeg.org/ffmpeg.git &lt;target&gt;
  99. </pre></div>
  100. <p>This will put the FFmpeg sources into the directory <var>&lt;target&gt;</var>.
  101. </p>
  102. <div class="example">
  103. <pre class="example">git clone git@source.ffmpeg.org:ffmpeg &lt;target&gt;
  104. </pre></div>
  105. <p>This will put the FFmpeg sources into the directory <var>&lt;target&gt;</var> and let
  106. you push back your changes to the remote repository.
  107. </p>
  108. <div class="example">
  109. <pre class="example">git clone gil@ffmpeg.org:ffmpeg-web &lt;target&gt;
  110. </pre></div>
  111. <p>This will put the source of the FFmpeg website into the directory
  112. <var>&lt;target&gt;</var> and let you push back your changes to the remote repository.
  113. (Note that <var>gil</var> stands for GItoLite and is not a typo of <var>git</var>.)
  114. </p>
  115. <p>If you don&rsquo;t have write-access to the ffmpeg-web repository, you can
  116. create patches after making a read-only ffmpeg-web clone:
  117. </p>
  118. <div class="example">
  119. <pre class="example">git clone git://ffmpeg.org/ffmpeg-web &lt;target&gt;
  120. </pre></div>
  121. <p>Make sure that you do not have Windows line endings in your checkouts,
  122. otherwise you may experience spurious compilation failures. One way to
  123. achieve this is to run
  124. </p>
  125. <div class="example">
  126. <pre class="example">git config --global core.autocrlf false
  127. </pre></div>
  128. <span id="Updating-the-source-tree-to-the-latest-revision"></span><a name="Updating-the-source-tree-to-the-latest-revision-1"></a>
  129. <h3 class="section">2.3 Updating the source tree to the latest revision<span class="pull-right"><a class="anchor hidden-xs" href="#Updating-the-source-tree-to-the-latest-revision-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Updating-the-source-tree-to-the-latest-revision-1" aria-hidden="true">TOC</a></span></h3>
  130. <div class="example">
  131. <pre class="example">git pull (--rebase)
  132. </pre></div>
  133. <p>pulls in the latest changes from the tracked branch. The tracked branch
  134. can be remote. By default the master branch tracks the branch master in
  135. the remote origin.
  136. </p>
  137. <div class="warning">
  138. <p><code>--rebase</code> (see below) is recommended.
  139. </p></div>
  140. <a name="Rebasing-your-local-branches"></a>
  141. <h3 class="section">2.4 Rebasing your local branches<span class="pull-right"><a class="anchor hidden-xs" href="#Rebasing-your-local-branches" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Rebasing-your-local-branches" aria-hidden="true">TOC</a></span></h3>
  142. <div class="example">
  143. <pre class="example">git pull --rebase
  144. </pre></div>
  145. <p>fetches the changes from the main repository and replays your local commits
  146. over it. This is required to keep all your local changes at the top of
  147. FFmpeg&rsquo;s master tree. The master tree will reject pushes with merge commits.
  148. </p>
  149. <a name="Adding_002fremoving-files_002fdirectories"></a>
  150. <h3 class="section">2.5 Adding/removing files/directories<span class="pull-right"><a class="anchor hidden-xs" href="#Adding_002fremoving-files_002fdirectories" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Adding_002fremoving-files_002fdirectories" aria-hidden="true">TOC</a></span></h3>
  151. <div class="example">
  152. <pre class="example">git add [-A] &lt;filename/dirname&gt;
  153. git rm [-r] &lt;filename/dirname&gt;
  154. </pre></div>
  155. <p>Git needs to get notified of all changes you make to your working
  156. directory that makes files appear or disappear.
  157. Line moves across files are automatically tracked.
  158. </p>
  159. <a name="Showing-modifications"></a>
  160. <h3 class="section">2.6 Showing modifications<span class="pull-right"><a class="anchor hidden-xs" href="#Showing-modifications" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Showing-modifications" aria-hidden="true">TOC</a></span></h3>
  161. <div class="example">
  162. <pre class="example">git diff &lt;filename(s)&gt;
  163. </pre></div>
  164. <p>will show all local modifications in your working directory as unified diff.
  165. </p>
  166. <a name="Inspecting-the-changelog"></a>
  167. <h3 class="section">2.7 Inspecting the changelog<span class="pull-right"><a class="anchor hidden-xs" href="#Inspecting-the-changelog" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Inspecting-the-changelog" aria-hidden="true">TOC</a></span></h3>
  168. <div class="example">
  169. <pre class="example">git log &lt;filename(s)&gt;
  170. </pre></div>
  171. <p>You may also use the graphical tools like <code>gitview</code> or <code>gitk</code>
  172. or the web interface available at <a href="http://source.ffmpeg.org/">http://source.ffmpeg.org/</a>.
  173. </p>
  174. <a name="Checking-source-tree-status"></a>
  175. <h3 class="section">2.8 Checking source tree status<span class="pull-right"><a class="anchor hidden-xs" href="#Checking-source-tree-status" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Checking-source-tree-status" aria-hidden="true">TOC</a></span></h3>
  176. <div class="example">
  177. <pre class="example">git status
  178. </pre></div>
  179. <p>detects all the changes you made and lists what actions will be taken in case
  180. of a commit (additions, modifications, deletions, etc.).
  181. </p>
  182. <a name="Committing"></a>
  183. <h3 class="section">2.9 Committing<span class="pull-right"><a class="anchor hidden-xs" href="#Committing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Committing" aria-hidden="true">TOC</a></span></h3>
  184. <div class="example">
  185. <pre class="example">git diff --check
  186. </pre></div>
  187. <p>to double check your changes before committing them to avoid trouble later
  188. on. All experienced developers do this on each and every commit, no matter
  189. how small.
  190. </p>
  191. <p>Every one of them has been saved from looking like a fool by this many times.
  192. It&rsquo;s very easy for stray debug output or cosmetic modifications to slip in,
  193. please avoid problems through this extra level of scrutiny.
  194. </p>
  195. <p>For cosmetics-only commits you should get (almost) empty output from
  196. </p>
  197. <div class="example">
  198. <pre class="example">git diff -w -b &lt;filename(s)&gt;
  199. </pre></div>
  200. <p>Also check the output of
  201. </p>
  202. <div class="example">
  203. <pre class="example">git status
  204. </pre></div>
  205. <p>to make sure you don&rsquo;t have untracked files or deletions.
  206. </p>
  207. <div class="example">
  208. <pre class="example">git add [-i|-p|-A] &lt;filenames/dirnames&gt;
  209. </pre></div>
  210. <p>Make sure you have told Git your name, email address and GPG key
  211. </p>
  212. <div class="example">
  213. <pre class="example">git config --global user.name &quot;My Name&quot;
  214. git config --global user.email my@email.invalid
  215. git config --global user.signingkey ABCDEF0123245
  216. </pre></div>
  217. <p>Enable signing all commits or use -S
  218. </p>
  219. <div class="example">
  220. <pre class="example">git config --global commit.gpgsign true
  221. </pre></div>
  222. <p>Use <samp>--global</samp> to set the global configuration for all your Git checkouts.
  223. </p>
  224. <p>Git will select the changes to the files for commit. Optionally you can use
  225. the interactive or the patch mode to select hunk by hunk what should be
  226. added to the commit.
  227. </p>
  228. <div class="example">
  229. <pre class="example">git commit
  230. </pre></div>
  231. <p>Git will commit the selected changes to your current local branch.
  232. </p>
  233. <p>You will be prompted for a log message in an editor, which is either
  234. set in your personal configuration file through
  235. </p>
  236. <div class="example">
  237. <pre class="example">git config --global core.editor
  238. </pre></div>
  239. <p>or set by one of the following environment variables:
  240. <var>GIT_EDITOR</var>, <var>VISUAL</var> or <var>EDITOR</var>.
  241. </p>
  242. <a name="Writing-a-commit-message"></a>
  243. <h3 class="section">2.10 Writing a commit message<span class="pull-right"><a class="anchor hidden-xs" href="#Writing-a-commit-message" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Writing-a-commit-message" aria-hidden="true">TOC</a></span></h3>
  244. <p>Log messages should be concise but descriptive.
  245. </p>
  246. <p>The first line must contain the context, a colon and a very short
  247. summary of what the commit does. Details can be added, if necessary,
  248. separated by an empty line. These details should not exceed 60-72 characters
  249. per line, except when containing code.
  250. </p>
  251. <p>Example of a good commit message:
  252. </p>
  253. <div class="example">
  254. <pre class="example">avcodec/cbs: add a helper to read extradata within packet side data
  255. Using ff_cbs_read() on the raw buffer will not parse it as extradata,
  256. resulting in parsing errors for example when handling ISOBMFF avcC.
  257. This helper works around that.
  258. </pre></div>
  259. <div class="example">
  260. <pre class="example">ptr might be NULL
  261. </pre></div>
  262. <p>If the summary on the first line is not enough, in the body of the message,
  263. explain why you made a change, what you did will be obvious from the changes
  264. themselves most of the time. Saying just &quot;bug fix&quot; or &quot;10l&quot; is bad. Remember
  265. that people of varying skill levels look at and educate themselves while
  266. reading through your code. Don&rsquo;t include filenames in log messages except in
  267. the context, Git provides that information.
  268. </p>
  269. <p>If the commit fixes a registered issue, state it in a separate line of the
  270. body: <code>Fix Trac ticket #42.</code>
  271. </p>
  272. <p>The first line will be used to name
  273. the patch by <code>git format-patch</code>.
  274. </p>
  275. <p>Common mistakes for the first line, as seen in <code>git log --oneline</code>
  276. include: missing context at the beginning; description of what the code did
  277. before the patch; line too long or wrapped to the second line.
  278. </p>
  279. <a name="Preparing-a-patchset"></a>
  280. <h3 class="section">2.11 Preparing a patchset<span class="pull-right"><a class="anchor hidden-xs" href="#Preparing-a-patchset" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Preparing-a-patchset" aria-hidden="true">TOC</a></span></h3>
  281. <div class="example">
  282. <pre class="example">git format-patch &lt;commit&gt; [-o directory]
  283. </pre></div>
  284. <p>will generate a set of patches for each commit between <var>&lt;commit&gt;</var> and
  285. current <var>HEAD</var>. E.g.
  286. </p>
  287. <div class="example">
  288. <pre class="example">git format-patch origin/master
  289. </pre></div>
  290. <p>will generate patches for all commits on current branch which are not
  291. present in upstream.
  292. A useful shortcut is also
  293. </p>
  294. <div class="example">
  295. <pre class="example">git format-patch -n
  296. </pre></div>
  297. <p>which will generate patches from last <var>n</var> commits.
  298. By default the patches are created in the current directory.
  299. </p>
  300. <a name="Sending-patches-for-review"></a>
  301. <h3 class="section">2.12 Sending patches for review<span class="pull-right"><a class="anchor hidden-xs" href="#Sending-patches-for-review" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Sending-patches-for-review" aria-hidden="true">TOC</a></span></h3>
  302. <div class="example">
  303. <pre class="example">git send-email &lt;commit list|directory&gt;
  304. </pre></div>
  305. <p>will send the patches created by <code>git format-patch</code> or directly
  306. generates them. All the email fields can be configured in the global/local
  307. configuration or overridden by command line.
  308. Note that this tool must often be installed separately (e.g. <var>git-email</var>
  309. package on Debian-based distros).
  310. </p>
  311. <a name="Renaming_002fmoving_002fcopying-files-or-contents-of-files"></a>
  312. <h3 class="section">2.13 Renaming/moving/copying files or contents of files<span class="pull-right"><a class="anchor hidden-xs" href="#Renaming_002fmoving_002fcopying-files-or-contents-of-files" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Renaming_002fmoving_002fcopying-files-or-contents-of-files" aria-hidden="true">TOC</a></span></h3>
  313. <p>Git automatically tracks such changes, making those normal commits.
  314. </p>
  315. <div class="example">
  316. <pre class="example">mv/cp path/file otherpath/otherfile
  317. git add [-A] .
  318. git commit
  319. </pre></div>
  320. <a name="Git-configuration"></a>
  321. <h2 class="chapter">3 Git configuration<span class="pull-right"><a class="anchor hidden-xs" href="#Git-configuration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Git-configuration" aria-hidden="true">TOC</a></span></h2>
  322. <p>In order to simplify a few workflows, it is advisable to configure both
  323. your personal Git installation and your local FFmpeg repository.
  324. </p>
  325. <a name="Personal-Git-installation"></a>
  326. <h3 class="section">3.1 Personal Git installation<span class="pull-right"><a class="anchor hidden-xs" href="#Personal-Git-installation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Personal-Git-installation" aria-hidden="true">TOC</a></span></h3>
  327. <p>Add the following to your <samp>~/.gitconfig</samp> to help <code>git send-email</code>
  328. and <code>git format-patch</code> detect renames:
  329. </p>
  330. <div class="example">
  331. <pre class="example">[diff]
  332. renames = copy
  333. </pre></div>
  334. <a name="Repository-configuration"></a>
  335. <h3 class="section">3.2 Repository configuration<span class="pull-right"><a class="anchor hidden-xs" href="#Repository-configuration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Repository-configuration" aria-hidden="true">TOC</a></span></h3>
  336. <p>In order to have <code>git send-email</code> automatically send patches
  337. to the ffmpeg-devel mailing list, add the following stanza
  338. to <samp>/path/to/ffmpeg/repository/.git/config</samp>:
  339. </p>
  340. <div class="example">
  341. <pre class="example">[sendemail]
  342. to = ffmpeg-devel@ffmpeg.org
  343. </pre></div>
  344. <a name="FFmpeg-specific"></a>
  345. <h2 class="chapter">4 FFmpeg specific<span class="pull-right"><a class="anchor hidden-xs" href="#FFmpeg-specific" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FFmpeg-specific" aria-hidden="true">TOC</a></span></h2>
  346. <a name="Reverting-broken-commits"></a>
  347. <h3 class="section">4.1 Reverting broken commits<span class="pull-right"><a class="anchor hidden-xs" href="#Reverting-broken-commits" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Reverting-broken-commits" aria-hidden="true">TOC</a></span></h3>
  348. <div class="example">
  349. <pre class="example">git reset &lt;commit&gt;
  350. </pre></div>
  351. <p><code>git reset</code> will uncommit the changes till <var>&lt;commit&gt;</var> rewriting
  352. the current branch history.
  353. </p>
  354. <div class="example">
  355. <pre class="example">git commit --amend
  356. </pre></div>
  357. <p>allows one to amend the last commit details quickly.
  358. </p>
  359. <div class="example">
  360. <pre class="example">git rebase -i origin/master
  361. </pre></div>
  362. <p>will replay local commits over the main repository allowing to edit, merge
  363. or remove some of them in the process.
  364. </p>
  365. <div class="info">
  366. <p><code>git reset</code>, <code>git commit --amend</code> and <code>git rebase</code>
  367. rewrite history, so you should use them ONLY on your local or topic branches.
  368. The main repository will reject those changes.
  369. </p></div>
  370. <div class="example">
  371. <pre class="example">git revert &lt;commit&gt;
  372. </pre></div>
  373. <p><code>git revert</code> will generate a revert commit. This will not make the
  374. faulty commit disappear from the history.
  375. </p>
  376. <a name="Pushing-changes-to-remote-trees"></a>
  377. <h3 class="section">4.2 Pushing changes to remote trees<span class="pull-right"><a class="anchor hidden-xs" href="#Pushing-changes-to-remote-trees" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Pushing-changes-to-remote-trees" aria-hidden="true">TOC</a></span></h3>
  378. <div class="example">
  379. <pre class="example">git push origin master --dry-run
  380. </pre></div>
  381. <p>Will simulate a push of the local master branch to the default remote
  382. (<var>origin</var>). And list which branches and ranges or commits would have been
  383. pushed.
  384. Git will prevent you from pushing changes if the local and remote trees are
  385. out of sync. Refer to <a href="#Updating-the-source-tree-to-the-latest-revision">Updating the source tree to the latest revision</a>.
  386. </p>
  387. <div class="example">
  388. <pre class="example">git remote add &lt;name&gt; &lt;url&gt;
  389. </pre></div>
  390. <p>Will add additional remote with a name reference, it is useful if you want
  391. to push your local branch for review on a remote host.
  392. </p>
  393. <div class="example">
  394. <pre class="example">git push &lt;remote&gt; &lt;refspec&gt;
  395. </pre></div>
  396. <p>Will push the changes to the <var>&lt;remote&gt;</var> repository.
  397. Omitting <var>&lt;refspec&gt;</var> makes <code>git push</code> update all the remote
  398. branches matching the local ones.
  399. </p>
  400. <a name="Finding-a-specific-svn-revision"></a>
  401. <h3 class="section">4.3 Finding a specific svn revision<span class="pull-right"><a class="anchor hidden-xs" href="#Finding-a-specific-svn-revision" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Finding-a-specific-svn-revision" aria-hidden="true">TOC</a></span></h3>
  402. <p>Since version 1.7.1 Git supports &lsquo;<samp>:/foo</samp>&rsquo; syntax for specifying commits
  403. based on a regular expression. see man gitrevisions
  404. </p>
  405. <div class="example">
  406. <pre class="example">git show :/'as revision 23456'
  407. </pre></div>
  408. <p>will show the svn changeset &lsquo;<samp>r23456</samp>&rsquo;. With older Git versions searching in
  409. the <code>git log</code> output is the easiest option (especially if a pager with
  410. search capabilities is used).
  411. </p>
  412. <p>This commit can be checked out with
  413. </p>
  414. <div class="example">
  415. <pre class="example">git checkout -b svn_23456 :/'as revision 23456'
  416. </pre></div>
  417. <p>or for Git &lt; 1.7.1 with
  418. </p>
  419. <div class="example">
  420. <pre class="example">git checkout -b svn_23456 $SHA1
  421. </pre></div>
  422. <p>where <var>$SHA1</var> is the commit hash from the <code>git log</code> output.
  423. </p>
  424. <a name="gpg-key-generation"></a>
  425. <h2 class="chapter">5 gpg key generation<span class="pull-right"><a class="anchor hidden-xs" href="#gpg-key-generation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gpg-key-generation" aria-hidden="true">TOC</a></span></h2>
  426. <p>If you have no gpg key yet, we recommend that you create a ed25519 based key as it
  427. is small, fast and secure. Especially it results in small signatures in git.
  428. </p>
  429. <div class="example">
  430. <pre class="example">gpg --default-new-key-algo &quot;ed25519/cert,sign+cv25519/encr&quot; --quick-generate-key &quot;human@server.com&quot;
  431. </pre></div>
  432. <p>When generating a key, make sure the email specified matches the email used in git as some sites like
  433. github consider mismatches a reason to declare such commits unverified. After generating a key you
  434. can add it to the MAINTAINER file and upload it to a keyserver.
  435. </p>
  436. <a name="Pre_002dpush-checklist"></a>
  437. <h2 class="chapter">6 Pre-push checklist<span class="pull-right"><a class="anchor hidden-xs" href="#Pre_002dpush-checklist" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Pre_002dpush-checklist" aria-hidden="true">TOC</a></span></h2>
  438. <p>Once you have a set of commits that you feel are ready for pushing,
  439. work through the following checklist to doublecheck everything is in
  440. proper order. This list tries to be exhaustive. In case you are just
  441. pushing a typo in a comment, some of the steps may be unnecessary.
  442. Apply your common sense, but if in doubt, err on the side of caution.
  443. </p>
  444. <p>First, make sure that the commits and branches you are going to push
  445. match what you want pushed and that nothing is missing, extraneous or
  446. wrong. You can see what will be pushed by running the git push command
  447. with <samp>--dry-run</samp> first. And then inspecting the commits listed with
  448. <code>git log -p 1234567..987654</code>. The <code>git status</code> command
  449. may help in finding local changes that have been forgotten to be added.
  450. </p>
  451. <p>Next let the code pass through a full run of our test suite.
  452. </p>
  453. <ul>
  454. <li> <code>make distclean</code>
  455. </li><li> <code>/path/to/ffmpeg/configure</code>
  456. </li><li> <code>make fate</code>
  457. </li><li> if fate fails due to missing samples run <code>make fate-rsync</code> and retry
  458. </li></ul>
  459. <p>Make sure all your changes have been checked before pushing them, the
  460. test suite only checks against regressions and that only to some extend. It does
  461. obviously not check newly added features/code to be working unless you have
  462. added a test for that (which is recommended).
  463. </p>
  464. <p>Also note that every single commit should pass the test suite, not just
  465. the result of a series of patches.
  466. </p>
  467. <p>Once everything passed, push the changes to your public ffmpeg clone and post a
  468. merge request to ffmpeg-devel. You can also push them directly but this is not
  469. recommended.
  470. </p>
  471. <a name="Server-Issues"></a>
  472. <h2 class="chapter">7 Server Issues<span class="pull-right"><a class="anchor hidden-xs" href="#Server-Issues" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Server-Issues" aria-hidden="true">TOC</a></span></h2>
  473. <p>Contact the project admins at <a href="mailto:root@ffmpeg.org">root@ffmpeg.org</a> if you have technical
  474. problems with the Git server.
  475. </p> <p style="font-size: small;">
  476. This document was generated using <a href="https://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
  477. </p>
  478. </div>
  479. </body>
  480. </html>