483
edits
mNo edit summary |
(→Commiting changes: Updated to be more clear and concise; note that all these steps apply to Linux too) |
||
Line 101: | Line 101: | ||
As a developer, you probably want to share your work with the world. For FlightGear, most developers do this by commiting stuff to the Git repository. | As a developer, you probably want to share your work with the world. For FlightGear, most developers do this by commiting stuff to the Git repository. | ||
=== Getting started === | |||
# Register an account at [http://gitorious.org Gitorious]. | # Register an account at [http://gitorious.org Gitorious]. | ||
# [http://gitorious.org/fg/fgdata/clone Clone fgdata]. | # [http://gitorious.org/fg/fgdata/clone Clone fgdata]. | ||
Line 110: | Line 110: | ||
# Visit your dashboard at Gitorious and navigate to "Manage SSH keys". | # Visit your dashboard at Gitorious and navigate to "Manage SSH keys". | ||
# Click the "Add SSH key" button and paste the content of the .pub file. Follow the instructions on the screen. | # Click the "Add SSH key" button and paste the content of the .pub file. Follow the instructions on the screen. | ||
# | # Open Git Bash in your data directory and run ''git remote add fgdata git://gitorious.org/fg/fgdata.git''. This adds a remote ref to the master fgdata repository in Gitorious. You can also add the mapserver URL by running ''git remote add fgdata-mapserver git://mapserver.flightgear.org/fgdta/'', which may be faster than Gitorious. | ||
# Now run ''git remote set-url origin <url>'', where ''<url>'' is the line that you get by clicking SSH on your fgdata clone page at Gitorious (should be something like ''git@gitorious.org:~your/fg/yours-fgdata.git''). This switches the origin ref to the correct URL that Gitorious will take when updating. | |||
It is recommended to split your new fgdata clone into separate local branches for your work. For instance, if you're working on the [[Boeing 747-400]] and the [[Howto: Aircraft Reflection Shader|aircraft reflection shader]], you might create 2 branches named "747-400" and "reflect-shader". To do this, | |||
# ''git checkout master'' | |||
# ''git branch <branch name>'' | |||
# ''git checkout <branch name>'' | |||
Then you can make your changes to the new local branch(es), which will make merge requests easier for both yourself and committers. To switch in between branches, simply use | |||
* ''git checkout <branch name>'' | |||
=== Pulling === | |||
* < | To pull updates from the master fgdata repository, | ||
* <branch name> is the name of the branch you want to update. | |||
* <ref> is the repository ref. If you followed the [[#Getting Started|getting started]] section, this will be "fgdata" or "fgdata-mapserver". | |||
# ''git checkout <branch name>'' | |||
# ''git pull <ref>'' | |||
# Assuming you got no merging errors, run ''git push origin <branch name>'' to push the updates out to Gitorious. | |||
=== Pushing === | |||
# ''git checkout | {{WIP}} | ||
# ''git | To push local updates to your fgdata clone, | ||
# ''git | * <branch name> is the name of the local branch you want to push. | ||
# | # ''git checkout <branch name>'' | ||
# Use ''git status --'' to list all the changed files. | |||
## If you want to commit all changed files, run ''git commit -a'' and type your commit message. | |||
## If you only want to commit some files, run ''git add <path/to/file>'' to add certain files (you can use ''git add --all <path/to/folder>'' to add all files within a certain folder) and ''git rm <path/to/file>'' to mark files you have removed for deletion in the repository. | |||
# If you used ''git commit -a'', the commit has already been created for you. Otherwise, run ''git commit -m "<commit message>"'' (quotes required), where <commit message> is the message for your commit (i.e. "747-400: Improved lightmaps"). | |||
# ''git push origin <branch name>'' | |||
==== Creating a merge request ==== | |||
# Check that the commit to your fgdata clone is recognized by Gitorious. | |||
# Check that the commit to your fgdata clone is | |||
# Click the "Request merge" button on your fgdata clone page. Loading the next page can take a while, as it will list all commits of the past years! | # Click the "Request merge" button on your fgdata clone page. Loading the next page can take a while, as it will list all commits of the past years! | ||
# Once again write a short summary (could be the same as used with git commit), but this time, also write an explanation of your merge request (what does it do). Make sure you set target repository to fgdata, Target Branch to master and Source Branch to | # Once again write a short summary (could be the same as used with git commit), but this time, also write an explanation of your merge request (what does it do). Make sure you set target repository to fgdata, Target Branch to master and Source Branch to the local branch with your updates. | ||
# Tick the box in front of your commit and click the "Create merge request" button. | # Tick the box in front of your commit and click the "Create merge request" button. | ||
# Now, all you have to do is contact a [http://gitorious.org/+flightgear-developers contributor] and wait | # Now, all you have to do is contact a [http://gitorious.org/+flightgear-developers contributor] and wait untill he accepts your merge request ;) | ||
Creating merge requests using this method literally means merging an entire branch into fgdata; this may not be desirable for some situations, such as small changes that only require one little commit. There's a neat method to only push certain commits to a merge request discussed by Anders Gidenstam [http://flightgear.org/forums/viewtopic.php?f=4&t=10392&start=45#p115747 on the FlightGear Forums]. | |||
# | |||
edits