20,741
edits
(→Messed up branches: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg30844.html) |
(→Some more helpful commands: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg30755.html) |
||
Line 305: | Line 305: | ||
;<code>git pull</code>''' | ;<code>git pull</code>''' | ||
: may be used for future updates | : may be used for future updates | ||
=== git pull === | |||
git pull will also work if you have committed local changes but will make your local history messy (and the official history too if your changes | |||
are ever merged back into the official history). If you don't care about the messyness of your local history read no further than point 1 below and use git pull without hesitation :) | |||
If you do have changes you want to keep I'd recommend using git rebase to keep them "on top" of the official work: | |||
1. First commit your changes to your local branch. | |||
<pre> | |||
git status - show you what files you have modified. | |||
git add file1 file2 etc - adds the files you want to commit | |||
git commit - creates a commit with the changes you have added. | |||
</pre> | |||
2. Fetch the latest stuff from the main repository. | |||
<pre> | |||
git fetch | |||
</pre> | |||
3. Rebase your local branch on top of the latest official state. | |||
For the FlightGear and SimGear sources this would be | |||
<pre> | |||
git rebase origin/next | |||
</pre> | |||
For fgdata it is | |||
<pre> | |||
git rebase origin/master | |||
</pre> | |||
4. If you get conflicts you can drop your local conflicting commit by | |||
<pre> | |||
git rebase --skip | |||
</pre> | |||
or resolve the conflicts, git add the changed files and continue the rebase with | |||
<pre> | |||
git rebase --continue | |||
</pre> | |||
(Use of git status is needed here to see which files are in conflict). | |||
As an additional safe-guard you may create a name for your previous work | |||
before you rebase so that you can easily recover it if the rebase goes | |||
bad. Assuming your branch is called my-branch the following command | |||
creates a back-up point: | |||
<pre> | |||
git branch my-branch.20110205 my-branch | |||
</pre> | |||
=== Tracking a release branch === | === Tracking a release branch === |