652
edits
m ((Still Updating, Part 3 till update repositories to come)) |
m (Still updating - final merge to GIT still in review) |
||
Line 9: | Line 9: | ||
* '''Mac OS X:''' [[FlightGear Git on Mac OS X]] | * '''Mac OS X:''' [[FlightGear Git on Mac OS X]] | ||
* '''Windows:''' [[FlightGear Git on Windows]] | * '''Windows:''' [[FlightGear Git on Windows]] | ||
* in addition [[Howto:Start using git]] provides a quick introduction to using git. | |||
[[Howto:Start using git]] provides a quick introduction to using git. | <br /> | ||
== '''Motivation''' == | == '''Motivation''' == | ||
Line 23: | Line 23: | ||
== '''Manipulating the GIT''' == | == '''Manipulating the GIT''' == | ||
=== Overview === | === Overview === | ||
[[File:GIT-Workflow.png|Cloning and manipulating the GIT]] | |||
For a detailed description see the description of the 4 repositories (A,B,C,D) in the following chapters | |||
<br /><br /> | <br /><br /> | ||
=== A) Repositories and branches === | === A) Repositories and branches === | ||
Line 156: | Line 154: | ||
You should be suspicious if based on the printed progress you estimate the data download during the fetch will exceed 1GB (assuming the bundle is not terribly outdated). | You should be suspicious if based on the printed progress you estimate the data download during the fetch will exceed 1GB (assuming the bundle is not terribly outdated). | ||
<br /><br /> | <br /><br /> | ||
=== D) | === D) Edit and Commit Data === | ||
====Edit==== | |||
Switch into the branch in which you want to edit your changes ''(without affecting your master yet!)''. We will use for that branch the name "master.local". Thus: | Switch into the branch in which you want to edit your changes ''(without affecting your master yet!)''. We will use for that branch the name "master.local". Thus: | ||
;<code>git checkout master</code> | ;<code>git checkout master</code> | ||
Line 187: | Line 186: | ||
::*:Try first: '''''"git branch master.local -d"''''' ⇒ that will delete it if it is "clean" | ::*:Try first: '''''"git branch master.local -d"''''' ⇒ that will delete it if it is "clean" | ||
::*:If needed do: '''''"git branch -D master.local"''''' ⇒ that forces a delete - <span style="color:red">'''''even if there is uncommitted work in it !!'''''</span> | ::*:If needed do: '''''"git branch -D master.local"''''' ⇒ that forces a delete - <span style="color:red">'''''even if there is uncommitted work in it !!'''''</span> | ||
<br /> | <br /><span style="color:green"> | ||
You may now apply your planned changes | '''''You may now | ||
*apply your planned changes into the affected "/GIT/subdir" | |||
*start FlightGear to verify they are proper/functional | |||
<br /> | *then check what was done:''''' | ||
</span><br /> | |||
;<code>git status</code> | ;<code>git status</code> | ||
:''(the output may take some time to appear! | |||
:see e.g. a dummy-example:)'' | |||
<small> | <small> | ||
..GIT/fgdata$ '''git status''' | ..GIT/fgdata$ '''git status''' | ||
Line 210: | Line 212: | ||
...... etc. | ...... etc. | ||
</small> | </small> | ||
: | :This gives you a list of files that have been altered or that are new. In the above ''(dummy example)'' you see: | ||
:*the already existing file "Aircraft/ATC-ML/Version" was modified | :*the already existing file "Aircraft/ATC-ML/Version" was modified | ||
:*a new file "Aircraft/ATC-ML/Version (copy)" was added | :*a new file "Aircraft/ATC-ML/Version (copy)" was added | ||
:*and a new directory "Aircraft/DUMMY/" was added, including all its files | :*and a new directory "Aircraft/DUMMY/" was added, including all its files | ||
<br /> | <br /> | ||
If that is what you wanted/needed continue with the following (otherwise correct your work first) | If that is what you wanted/needed continue with the following ''(otherwise correct your work first)'' | ||
<br /> | <br /><br /> | ||
;<code>git add - | '''''So we want to "add" those changes:''''' | ||
;<code>git add "Aircraft/ATC-ML/Version (copy)"</code> | |||
;<code>git add Aircraft/ATC-ML/Version</code> | |||
;<code>git add Aircraft/DUMMY/</code> | |||
: '''< | If you now perform the '''git status''' again you should see something similar to: | ||
<small> | |||
../GIT/fgdata$ ''git status'' | |||
# On branch master.local | |||
# '''''Changes to be committed:''''' | |||
# (use "git reset HEAD <file>..." to unstage) | |||
# | |||
# modified: Aircraft/ATC-ML/Version | |||
# new file: Aircraft/ATC-ML/Version (copy) | |||
# new file: Aircraft/DUMMY/ATC-ML (copy).xml | |||
# new file: Aircraft/DUMMY/ATC-ML-set.xml | |||
# new file: Aircraft/DUMMY/ATC-ML.ac | |||
# new file: Aircraft/DUMMY/ATC-ML.nas | |||
''... etc.'' | |||
# | |||
</small> | |||
If that is all you need - you may "commit" it: | |||
<br /><br /> | |||
===="Commit"==== | |||
;<code>git commit -m "''your short, accompanying Announcement''"</code> | |||
: will commit the updates to the ''master.local'' branch. It shows a list compatible to the one created with the "git status" before, but this time this created something new! ''(Yes: You could have omitted the "git status" and just did the "commit" - but we suggest to "double-check" this way!)'' | |||
;<code>git log</code> | |||
<small> | <small> | ||
..GIT/fgdata$ | ..GIT/fgdata$ git log | ||
commit 7658c67c16a79900acf99dbfd85499b720dcc920 | |||
Author: YourName <Your eMail> | |||
Date: Mon Jun 4 19:14:29 2012 +0200 | |||
your short, accompanying Announcement | |||
</small> | </small> | ||
: This is the "commit" as it will be tracked within the GIT. | |||
: You definitely should now copy the ID ''(the first 8 digits may be enough)'' to use it later as a unique identifier! | |||
Now return to your local "master" with: | |||
;<code>git checkout master</code> | |||
;<code><nowiki>git fetch git://gitorious.org/fg/fgdata.git</nowiki></code> | |||
;<code> | :<small>replace in that line the "fgdata.git" with the repository you are actually working on</small> | ||
:this will update the master to the newest GIT-level ''(there may have been changes during all that time!)'' | |||
: | |||
: | |||
;<code>git cherry-pick 7658c67c</code> | |||
< | :<small>replace the "7658c67c" with the first digits of your commit-ID (see above "git log")</small> | ||
:will pull the commit into the "master" | |||
: will commit the | |||
;<code>git rebase origin/master</code> | |||
:finally update the "master" with the "commit" on top of it | |||
<br /> | <br /> | ||
=== Push your changes to your clone on Gitorious === | === Push your changes to your clone on Gitorious === | ||
;<code>git push git@gitorious.org:~YourID/fg/YourIDs-fgdata.git</code> | |||
<small> | |||
::replace "YourID" with your login-name for Gitorious, do not forget the "~" in front of it! | |||
::replace in that line the "fgdata.git" with the repository you are actually working on | |||
</small> | |||
:will finally push your updates to your space inside "gitorious.org" | |||
Now you can announce to GIT that you have a change that may be merged into the original GIT: | |||
*Open your git-clone on Gitorious: https://gitorious.org/~YourID/fg/YourID-fgdata | |||
*and click the "Request merge" button on the right: | |||
<br /> | |||
{| | |||
||[[File:Create merge request at Gitorious.png|left|thumb|270px|Creating a merge request at Gitorious.]]|| | |||
Write a short summary in which you explain what your commit(s) do. Then choose the following settings: | |||
: '''Target directory:''' fgdata | : '''Target directory:''' fgdata | ||
: '''Target branch:''' master | : '''Target branch:''' master | ||
: '''Source branch:''' master | : '''Source branch:''' master | ||
Next select the commits you'd like to include in your merge request and click "Create merge request". | Next select the commits you'd like to include in your merge request and click "Create merge request". | ||
|} | |||
=== '''Commit the changes into the GIT''' === | |||
== '''Commit the changes into the GIT''' == | <span style="color:red">'''''This step is for developers with fgdata commit access only!'''''</span> | ||
'''This step is for developers with fgdata commit access only!''' | <br /> | ||
See e.g. https://gitorious.org/+flightgear-developers/memberships | |||
<br /> | |||
To push merge request to fgdata, the following workflow can be followed: | To push merge request to fgdata, the following workflow can be followed: | ||
git checkout -b integration # the integration branch should not yet exist. You can use any name you'd like | git checkout -b integration # the integration branch should not yet exist. You can use any name you'd like | ||
Line 307: | Line 305: | ||
<br /><br /> | <br /><br /> | ||
---- | ---- | ||
== ''' | == '''Supporting Informations''' == | ||
=== Some more helpful commands === | |||
;<code>git help</code> | |||
;<code>git help [commad]</code> | |||
;<code>git apply</code> | |||
: apply a patch to files and/or to the index http://www.kernel.org/pub/software/scm/git/docs/git-apply.html | |||
;<code>git checkout -f</code> | |||
: may be used to throw away any local changes to the ''working tree''. Use with care, as any option that name is <tt>-f</tt> or <tt>--force</tt>, and only after reading <code>git checkout help</code>! | |||
;<code>git pull</code>''' | |||
: may be used for future updates | |||
<br /> | |||
=== Tracking a release branch === | |||
<pre> | |||
git branch -t -l release/2.6.0 origin/release/2.6.0 | |||
git checkout -b release/2.6.0 | |||
</pre> | |||
=== Git tutorials and resources === | === Git tutorials and resources === | ||
* Git [http://git-scm.com/documentation documentation and tutorials] | * Git [http://git-scm.com/documentation documentation and tutorials] | ||
* Git Basics [http://schacon.github.com/git/gittutorial.html] | |||
* Git as a [http://tomayko.com/topics/git way of life]. | * Git as a [http://tomayko.com/topics/git way of life]. | ||
* The [http://zrusin.blogspot.com/2007/09/git-cheat-sheet.html Git Cheat Sheet] and the [http://jan-krueger.net/development/git-cheat-sheet-extended-edition Git Cheat Sheet Extended Edition] | * The [http://zrusin.blogspot.com/2007/09/git-cheat-sheet.html Git Cheat Sheet] and the [http://jan-krueger.net/development/git-cheat-sheet-extended-edition Git Cheat Sheet Extended Edition] |
edits