-
Notifications
You must be signed in to change notification settings - Fork 54
Backporting tutorial
stfx edited this page Aug 27, 2012
·
2 revisions
This tutorial was written by stfx for Mangos-One and Mangos-Zero developers to correctly backport commits from master.
- Clone mangos-one
- Add mangos-master remote:
git remote add -t master mangos _url_
- Download the mangos backport script and place it in your .git directory: http://repo.or.cz/w/gitlog.git/blob_plain/mangos:/mangos-backport.sh
- Fetch from mangos-master every time something changes there:
git fetch mangos
- Use backport tool in git bash:
.git/mangos-backport.sh _commit_hash_
- Check and resolve conflicts (usually there is a conflict because of changed revision_nr.h)
- Amend commit and change commit message if needed:
git commit --amend
- Fetch from mangos-master (like before)
- Use backport tool (like before)
- Check and resolve conflicts (like before)
- Rename the sql updates in sql/updates directory by adding this commit's version number at the start of the filename like so: 11754_01_mangos_mangos_string.sql -> s1415_11754_01_mangos_mangos_string.sql
- Remove the lines related to db_version change (in the sql update file usually the first one and the empty line after that)
- Amend commit (like before)
- Build git_id tool in release mode if you did not already (located in contrib\git_id)
- Use git_id in git bash:
contrib/git_id/Release/git_id.exe
- This only works if you push every time you commit something but it is also possible to use git_id.exe -l for local mode but then you can not use git_id.exe -s
- Use
contrib/git_id/Release/git_id.exe -s
so that all db_version changes will be automatically written to mangos.sql and in the sql/updates/*.sql- You have to push every outstanding commit before that because git_id.exe -s does not work with git_id.exe -l
- Push only to the mangos-one remote:
git push origin master
(depends how you named the mangos-one remote)