So, in a PR discussion Marcel explained some basics to Sloth and I said I'd fix the error made. However, doing this is somethign I've only recently learnt how to do properly so I thought I'd post the commands I used, partially as reference and partially for others (plus, someone might observe an improvement I could make to my taskflow).
Code: Select all
matgb@MatGB-Desktop:~/freeorion$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'master/master'.
matgb@MatGB-Desktop:~/freeorion$ git fetch master
remote: Counting objects: 105, done.
remote: Compressing objects: 100% (79/79), done.
remote: Total 105 (delta 60), reused 25 (delta 25), pack-reused 1
Receiving objects: 100% (105/105), 349.28 KiB | 677.00 KiB/s, done.
Resolving deltas: 100% (60/60), completed with 13 local objects.
From https://github.com/freeorion/freeorion
1e8c148..cfd3060 master -> master/master
matgb@MatGB-Desktop:~/freeorion$ git rebase
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/master/master.
matgb@MatGB-Desktop:~/freeorion$ git fetch sloth
remote: Counting objects: 122, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 122 (delta 85), reused 75 (delta 75), pack-reused 24
Receiving objects: 100% (122/122), 164.37 KiB | 0 bytes/s, done.
Resolving deltas: 100% (89/89), completed with 38 local objects.
From https://github.com/deepsloth/freeorion
* [new branch] LEMBALALAM -> sloth/LEMBALALAM
* [new branch] Lembala -> sloth/Lembala
* [new branch] asteroid_coating -> sloth/asteroid_coating
* [new branch] defense_network_icon -> sloth/defense_network_icon
* [new branch] field_descriptions -> sloth/field_descriptions
* [new branch] genetic_engineering_icon_fix -> sloth/genetic_engineering_icon_fix
* [new branch] ground_guardians -> sloth/ground_guardians
* [new branch] kraken_in_the_ice -> sloth/kraken_in_the_ice
* [new branch] natives_specials_tweak -> sloth/natives_specials_tweak
matgb@MatGB-Desktop:~/freeorion$ git cherry-pick abe72ef
[master 1259612] Added the new special: Kraken in the Ice.
Author: Sloth <[email protected]>
Date: Tue Aug 9 10:33:17 2016 +0200
5 files changed, 105 insertions(+)
create mode 100644 default/scripting/monster_designs/SM_WHITE_KRAKEN.focs.txt
create mode 100644 default/scripting/ship_hulls/monster/SH_WHITE_KRAKEN_BODY.focs.txt
create mode 100644 default/scripting/specials/KRAKEN_IN_THE_ICE.focs.txt
matgb@MatGB-Desktop:~/freeorion$ git cherry-pick a0265da
[master 12a2698] Fixed and tweaked the Kraken in the Ice special.
Author: Sloth <[email protected]>
Date: Thu Sep 29 20:07:06 2016 +0200
3 files changed, 4 insertions(+), 3 deletions(-)
matgb@MatGB-Desktop:~/freeorion$
Doing this requires having the person whose work you're cherry picking set as a remote in your Git setup, that's something I've done for most of our regular contributors, it also requires the use of the very powerful Rebase command.
NB: I massively prefer to learn to use the Command Line with Git as a) it's cross platform so I can do exactly the same thing on Windows as Linux and b) there's little chance of a GitGUI developer deciding to redo their interface entirely just after I've got used to it (as happened with gitg when I upgraded my Linux install, the new version is weird and hides how to cherry-pick so well I haven't found it yet).
The important lines above are
Code: Select all
git checkout master
git fetch master
Slight confusion here, I've made the mistake of both naming the FO Github repository as master and then we have the main branch called master, the first line makes sure I'm working in my master branch that always remains a direct copy of master, the second then grabs an updated version of master from the server
This updates my version of master, if there was any work there it would check for conflicts and make sure my work was listed as most recent ready to be pushed to master on the server.
This grabs an updated version of Sloth's github profile with all the work he's made PRs from, it lists all branches and similar.
Code: Select all
git cherry-pick abe72ef
git cherry-pick a0265da
These two lines simply grab the commits I want from Sloth's work and put them into the branch I'm working on.
Then I simply push it to master directly, or if I wanted I could work on it then push, etc.
The more I learn about Git the more impressed I am, but I find you have to understand the logic of what it's doing and why in order to remember which commands do what, and it doesn't always use earth logic when doing so (plus, my old GUI cherry picked from a branch and you told it where to go, but the command line needs you to be in the destination branch and tell it what you want).