It will assume the target revision to be "git HEAD".
1) Checkout the current git version:
Code: Select all
$ git clone git://source.ffmpeg.org/ffmpeg.git
Before touching the git checkout, make a copy. This makes it easier to rollback or do other stuff against a fresh git revision, rather than pulling it off the server all the time.
I'll call the folder copy "ffmpeg-git-FRESH":
Code: Select all
cp -av ffmpeg-git ffmpeg-git-FRESH
Now, edit your copy of FFmpeg as it fits your needs.
3) Add and commit your changes:
For those SVN users (like me) who'd now think: "commit my changes? upstream? me? how?!?"
Committing your changes to your git tree are only done locally.
- Add your new files:
Code: Select all
$ git add <my_new_files>
- Commit:
Code: Select all
$ git commit
NOTE: Repeat this step for each change you'd consider to be reasonable to have its own patch file.
This makes reviewing patches easier for maintainers, and allows a more granular way of applying and reversing changes.
4) Update to recent git HEAD:
During the time you've been working on your changes, it's very likely that the hard-working, sedulous contributors and maintainers of FFmpeg have uploaded changes themselves.
Therefore, it's a good thing to update your working copy to the most recent state:
Code: Select all
$ git pull
It's a good thing to do a "make clean", recompile and test this version to see avoid conflicts of any kind.
5) Rebase:
In case your reflog says the following after "git pull":
And "git format-patch" generates patches for other people's commits contained in that pull, you have to "rebase" to the right branch: "origin/master"HEAD@{0}: pull: Merge made by the 'recursive' strategy.
Code: Select all
$ git rebase origin/master
Code: Select all
$ git format-patch HEAD~~
They will start with a zero-padded number. A patch filename may look like this for example:
That's it!0001-My_first_awesome_contribution_to_ffmpeg.patch
Links: