392
edits
m (very very minor changes ;)) |
(extended git commands for "Local Branch") |
||
Line 80: | Line 80: | ||
==== Local Branch ==== | ==== Local Branch ==== | ||
To make individual changes, like | To make individual changes, like editing a joystick file or add a plane to fgdata or patch the source code, it is recommended to create a local branch inside that repository. The following commands will describe a way to achieve this. But have in mind, that this is very basic and only suits for users who have minor changes. | ||
<b><code>cd</code></b> into the repositories folder, e.g. fgdata: | <b><code>cd</code></b> into the repositories folder, e.g. fgdata: | ||
;<code>git checkout -b master.local master</code> | ;<code>git checkout -b master.local master</code> | ||
: a new branch <tt>master.local</tt> is created out of the <tt>master</tt> branch and set as the active one. You may apply your individual stuff there. | : a new branch <tt>master.local</tt> is created out of the <tt>master</tt> branch and set as the active one. You may now apply your individual stuff there and start FlightGear to verify the changes are propper. | ||
If you conclude they are, you have to tell git about those changes: | |||
;<code>git status</code> | |||
: will give you a list of files that have been altered or that are new. | |||
;<code>git add -i</code> | |||
: will show the files that have been altered and give you options on what to do next. <code>git add</code> does not actually add the changes to ''master.local'' but adds them to the ''index''. | |||
: <b><tt>[a]dd</tt></b> will add new paths/files (called ''untracked'' in status) from the ''working tree'' to the ''index''. This has to be done only if you have added paths/files, like an aircraft, to the ''working tree''. | |||
: If git finds more than one ''untracked'' file/path, it will give you a numbered list and prompt to select which ones should be added. An empty input will exit this mode. See "Interactive mode" in [http://www.kernel.org/pub/software/scm/git/docs/git-add.html man git add] for more details. | |||
: <b><tt>[u]pdate</tt></b> is the next step and will update the altered and ''tracked'' files to the index in the same manner as explained in <tt>add</tt> untracked paths above. | |||
;<code>git commit</code> | |||
: will commit the ''indexed'' updates to the ''master.local'' branch. It opens a list of the updates in your standard editor. You may add a comment to that file describing the object of the commit. Save and exit the editor. You have now commited your changes inside the ''working tree'' to your personal branch. | |||
To update that personal branch from the remote one do the following steps: | To update that personal branch from the remote one do the following steps: | ||
Line 153: | Line 165: | ||
* Git [http://git-scm.com/documentation documentation and tutorials] | * Git [http://git-scm.com/documentation documentation and tutorials] | ||
* Git as a [http://tomayko.com/topics/git way of life]. | * Git as a [http://tomayko.com/topics/git way of life]. | ||
* The [https://git.wiki.kernel.org/index.php/GitCheatSheet Git Cheat Sheet] and the [http://jan-krueger.net/development/git-cheat-sheet-extended-edition Git Cheat Sheet Extended Edition] | |||
* [http://wiki.github.com/bogolisk/egg Egg], a cool Git emacs mode. | * [http://wiki.github.com/bogolisk/egg Egg], a cool Git emacs mode. | ||
* A guide to [http://nathanj.github.com/gitguide/ using Git on Windows] | * A guide to [http://nathanj.github.com/gitguide/ using Git on Windows] |
edits