Difference between revisions of "Guide to FS Open and git"

From FreeSpace Wiki
Jump to: navigation, search
(1st part - more to come)
 
(stage2; still more to come)
Line 3: Line 3:
 
(based on [[Getting_the_FreeSpace2:_SCP_Source_Code]])
 
(based on [[Getting_the_FreeSpace2:_SCP_Source_Code]])
  
Note: the guide assumes that you will be developing using a github fork (which is recommended for everyone, and is the only option for non-SCP members)
+
* Download and install [http://msysgit.github.io/ Git For Windows] (this is a degendency for TortoiseGit)
 +
* Download and install [http://code.google.com/p/tortoisegit/ TortoiseGit] (you probably need to reboot after installing)
 +
* Make a new folder on your HDD where you'd like to install the code. You'll need a fair bit of space for the code + the intermediate files when building it. Press right mouse and choose Git Clone from the list.
 +
(piccy)
 +
* A new window will open up. Cut and paste the URL of the FSO Github repository into the URL of repository box (https://github.com/scp-fs2open/fs2open.github.com.git)
 +
(piccy)
 +
* Press OK to begin downloading from the repository (this may take a few minutes, depending on the speed of your internet connection)
 +
 
 +
 
 +
== Simple Development: Git on Windows ==
 +
 
 +
Note: the guide assumes that you will be developing using a github fork (which is recommended for everyone, SCP members and non-members alike)
  
 
* Go to the [https://github.com github webpage] and create an account
 
* Go to the [https://github.com github webpage] and create an account
Line 10: Line 21:
 
* Record the URL for your newly forked copy of the FSO repository
 
* Record the URL for your newly forked copy of the FSO repository
 
(piccy)
 
(piccy)
* Download and install [http://msysgit.github.io/ Git For Windows]
+
* Get the code per the guide above (fix with proper intra-page link)
* Download and install [http://code.google.com/p/tortoisegit/ TortoiseGit] (you probably need to reboot after installing)
+
** Note: you need to use the URL for '''your forked repository''', not the main FSO repository listed above
* Make a new folder on your HDD where you'd like to install the code. You'll need a fair bit of space for the code + the intermediate files when building it. Press right mouse and choose Git Clone from the list.
+
* Right click on the repository directory and select TortoiseGit -> Create Branch
 +
** Note: all development should be done in a new branch, instead of being done in the "master" branch. It's just simpler
 +
(piccy)
 +
* In the new window, enter the name for the new branch, verify that the branch is based on HEAD (master) and check the "Switch to new branch" box
 +
(piccy)
 +
* Write some code
 +
* Test your new code
 +
* When you're happy with the code, right click on the repository directory and select TortoiseGit -> Diff
 +
(piccy)
 +
* Review your changes by double-clicking on all the files listed in the new window (ensure no unwanted changes have sneaked in!).
 +
** Note: this will start TortoiseGitMerge, which is also used to resolve conflicts
 +
(piccy)
 +
* When your review is complete, press "Commit"
 +
(piccy)
 +
* In the new window, add a commit message and press OK
 +
** Note: you can commit multiple times before pushing
 +
(piccy)
 +
* When the commit is complete, press the "push" button to send your commit(s) to your github repository
 
(piccy)
 
(piccy)
* A new window will open up. Cut and paste the URL of *your* forked repository into the URL of repository box
+
* Select your local branch name from the drop down list and ensure your Destination -> Remote: is "origin"
 +
* If you want to, you can give the public remote branch a different name to your local branch (this can be useful when rebasing a branch already published to your public repository)
 +
* Finally, press OK
 
(piccy)
 
(piccy)
* Press OK to begin downloading from the repository (this may take a few minutes, depending on the speed of your internet connection)
+
* Go to your Github Repository webpage and select

Revision as of 00:39, 24 February 2014

Getting the source: Git on Windows

(based on Getting_the_FreeSpace2:_SCP_Source_Code)

  • Download and install Git For Windows (this is a degendency for TortoiseGit)
  • Download and install TortoiseGit (you probably need to reboot after installing)
  • Make a new folder on your HDD where you'd like to install the code. You'll need a fair bit of space for the code + the intermediate files when building it. Press right mouse and choose Git Clone from the list.

(piccy)

(piccy)

  • Press OK to begin downloading from the repository (this may take a few minutes, depending on the speed of your internet connection)


Simple Development: Git on Windows

Note: the guide assumes that you will be developing using a github fork (which is recommended for everyone, SCP members and non-members alike)

(piccy)

  • Record the URL for your newly forked copy of the FSO repository

(piccy)

  • Get the code per the guide above (fix with proper intra-page link)
    • Note: you need to use the URL for your forked repository, not the main FSO repository listed above
  • Right click on the repository directory and select TortoiseGit -> Create Branch
    • Note: all development should be done in a new branch, instead of being done in the "master" branch. It's just simpler

(piccy)

  • In the new window, enter the name for the new branch, verify that the branch is based on HEAD (master) and check the "Switch to new branch" box

(piccy)

  • Write some code
  • Test your new code
  • When you're happy with the code, right click on the repository directory and select TortoiseGit -> Diff

(piccy)

  • Review your changes by double-clicking on all the files listed in the new window (ensure no unwanted changes have sneaked in!).
    • Note: this will start TortoiseGitMerge, which is also used to resolve conflicts

(piccy)

  • When your review is complete, press "Commit"

(piccy)

  • In the new window, add a commit message and press OK
    • Note: you can commit multiple times before pushing

(piccy)

  • When the commit is complete, press the "push" button to send your commit(s) to your github repository

(piccy)

  • Select your local branch name from the drop down list and ensure your Destination -> Remote: is "origin"
  • If you want to, you can give the public remote branch a different name to your local branch (this can be useful when rebasing a branch already published to your public repository)
  • Finally, press OK

(piccy)

  • Go to your Github Repository webpage and select