Pl/FlightGear Git na Windows: Difference between revisions

Jump to navigation Jump to search
Updated the article to match the English page, to remove Gitorious using the {{repo link}} subtemplates, and change the 'master' branch to 'next.
(Updated the article to match the English page, to remove Gitorious using the {{repo link}} subtemplates, and change the 'master' branch to 'next.)
Line 39: Line 39:


Dodaj następną komendę i kliknij Enter.
Dodaj następną komendę i kliknij Enter.
 
{{#tag:syntaxhighlight|{{fgdata clone}}|lang="sh"}}
git clone git://gitorious.org/fg/fgdata.git


Teraz msysGit pobierze cały katalog fgdata do wybranej przez ciebie lokalizacji <tt>FlightGear/data</tt>. '''To może zając kilka godzin w przypadku wolnych połączeń internetowych!'''
Teraz msysGit pobierze cały katalog fgdata do wybranej przez ciebie lokalizacji <tt>FlightGear/data</tt>. '''To może zając kilka godzin w przypadku wolnych połączeń internetowych!'''
Line 46: Line 45:
'''WAŻNE:''' Upewnij się, że używasz msysGit 1.7.0.2 lub nowszej wersji, wcześniejsze miały problem z pobieraniem dużych paczek i nie ściągną niczego większego niz 2Gb.
'''WAŻNE:''' Upewnij się, że używasz msysGit 1.7.0.2 lub nowszej wersji, wcześniejsze miały problem z pobieraniem dużych paczek i nie ściągną niczego większego niz 2Gb.


'''WAŻNE II:''' Some files demand that CR/LF (carriage return / line feed) line breaks are kept in the way they are stored on Gitorious. Make sure to set "git-config core.safecrlf true" and "git-config core.autocrlf false" in your options or you may receive nasty error or even a crash on startup of FG (e.g. fgtzfile_read(): : Invalid argument... Fatal error: Timezone reading failed).
'''WAŻNE II:''' Some files demand that CR/LF (carriage return / line feed) line breaks are preserved. Make sure to set "git-config core.safecrlf true" and "git-config core.autocrlf false" in your options or you may receive nasty error or even a crash on startup of FG (e.g. fgtzfile_read(): : Invalid argument... Fatal error: Timezone reading failed).


==== Metoda 2: ====
==== Metoda 2: ====
Line 83: Line 82:
i naciśnij enter
i naciśnij enter
następnie
następnie
  git checkout -b master origin/master
  git checkout -b next origin/next


Powinno być już naprawione.
Powinno być już naprawione.
Line 89: Line 88:


Teraz pobierz z GIT, aby zaktualizować ostatnie pliki, których używałeś:  
Teraz pobierz z GIT, aby zaktualizować ostatnie pliki, których używałeś:  
{{#tag:syntaxhighlight|
git pull git://gitorious.org/fg/fgdata.git master
{{fgdata source|cmd=git pull|protocol=git|type=git|post=next|full=1}}
| lang = "sh"
}}


=== Pobieranie plików binarnych ===
=== Pobieranie plików binarnych ===
Line 116: Line 117:
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 ===
== Related content ==
# Register an account at [http://gitorious.org Gitorious].
* [[FlightGear Git for laymen]]
# [http://gitorious.org/fg/fgdata/clone Clone fgdata].
* [[FlightGear Git: data developers]]
# Open Git Bash in your data directory and run ''ssh-keygen''.
* [[FlightGear Git: core developers]]
# Enter the name of the file in which you prefer to save the key and press Enter.
# Enter your password/passphrase and press Enter. You'll have to do this twice.
# Your key is now being generated. Open the .pub file with an editor (eg. Notepad++) and copy the content.
# 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.
# 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/fgdata/'', 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.
* &lt;ref&gt; 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 &lt;ref&gt;''
# Assuming you got no merging errors, run ''git push origin <branch name>'' to push the updates out to Gitorious.
 
=== Pushing ===
{{WIP}}
To push local updates to your fgdata clone,
* <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>''
 
==== Rebase the development branch ====
Normally developments take some time, so the root of a development branch most likely will be outdated by the time the development is finished and a merge can be prepared. In order to make the merge easier for the contributor, it could be helpful to rebase the development branch to the current HEAD of the master.
 
Let <branch name> be the name of the local branch you want to push, that branch contains your work.
Furthermore, <tt>fgdata</tt> refers to the repository at <tt>git://gitorious.org/fg/fgdata</tt>, i.e. the official repository, whereas <tt>origin</tt> refers to your personal Gitorious repository.(You can use <code>git remote -v</code> to learn about all the remotes and their names.)
 
# Switch to that branch: <code>git checkout <branch name></code>
# Rebase your branch to the current HEAD of fgdata/master: <code>git rebase fgdata/master</code>
# Push your rebased development branch to your personal Gitorious repo
## First try <code>git push origin</code>. If that produces some warnings about merges, you can
## force it by using <code>git push origin -f</code> .
 
For more details on what rebasing does, check out http://book.git-scm.com/4_rebasing.html.
 
==== Creating a merge request ====
# Check that the commit to your fgdata clone is recognized by Gitorious.
# 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 the local branch with your updates.
# 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 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://forum.flightgear.org/viewtopic.php?f=4&t=10392&start=45#p115747 on the FlightGear Forums].


[[Category:Git]]
[[Category:Git]]


[[en:FlightGear Git on Windows]]
[[en:FlightGear Git on Windows]]

Navigation menu