Difference between revisions of "Git"

From Hercules Wiki
Jump to: navigation, search
m (GreenBox moved page GIT to Git: It's Git, not GIT.)
(Using .diff/.patch files: removed svn references)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{incomplete|type=section}}
+
[[Category:incomplete]]
 
==Preface==
 
==Preface==
 
This article will cover the '''Git''' details related to Hercules. '''Git''' is a version control system that allows multiple users to contribute to the development of Hercules, if permitted. It is also the most efficient method to downloading the source code of Hercules.
 
This article will cover the '''Git''' details related to Hercules. '''Git''' is a version control system that allows multiple users to contribute to the development of Hercules, if permitted. It is also the most efficient method to downloading the source code of Hercules.
  
 
==About Git==
 
==About Git==
As mentioned above '''Subversion''' is a version control system that allows users to download the latest source code. It uses the structure of trunk and branch to declare the development code and the stable code. A '''trunk''' is referred to as the development code that needs to be tested and validated for bugs. A '''branch''' is typically used for developing larger features or as alternative development path, without breaking current trunk code. Exception to this is '''stable''', which is considered stable subset of trunk.
+
As mentioned above '''Git''' is a version control system that allows users to download the latest source code.
  
 
===Checkout===
 
===Checkout===
When you '''checkout''' a piece of code, it is downloaded, along with all history, properties and files, onto your machine so you can make local changes or use it in a production environment.  
+
When you '''clone''' a git repository, it is downloaded, along with all history, properties and files, onto your machine so you can make local changes or use it in a production environment.  
  
 
===Commit===
 
===Commit===
When you '''commit''' a piece of code, you are uploading your changes back to the server and increasing the revision number of the SVN by 1. The increase in revision number by 1 is done no matter how many changes are made per commit. Each commit includes the author's name, what they changed and when they changed it, which can be viewed and referenced later.  
+
When you '''commit''' a piece of code, you are saving a set of changes in a form that can be uploaded back to the server. Each commit includes the author's name, what they changed and when they changed it, which can be viewed and referenced later.
 +
 
 +
===Push===
 +
When you '''push''' your commits, you are sending your commits to the central git server, to make them available to other people.
  
 
Only members of the [[Staff|Hercules development team]] can commit code straight to the Hercules Git.
 
Only members of the [[Staff|Hercules development team]] can commit code straight to the Hercules Git.
  
===Update===
+
===Pull===
When you '''update''' your SVN, you are taking your local copy of the SVN that was previously '''checked out''' and applying the latest updates from the server to it. In this operation, many files are changed, but some are added, deleted or moved. When you update your copy of the SVN, a lot of conflicts can happen, so keep an eye out of those.
+
When you '''pull''' commits, you are downloading the latest commits that were pushed to the git repository, and merging them to your working copy. In this operation, many files are changed, but some are added, deleted or moved. When you pull changes, a lot of conflicts can happen, so keep an eye out of those.
  
===Making changes===
+
===Obtain/Install Git===
When you make a change to your copy of the Git on Windows, a number of different icons will appear in the directory of the SVN. Below is a brief explanation of what each of these icons mean:
+
Please see the [[:Category:Installation]] appropriate category for installation of Git on your operating system of choice and how to utilize it.
{|
+
|[[Image:SVN_red.jpg|Modified SVN tag]]
+
|Changes have been made from the original downloaded script this indicates what scripts you have modified.
+
|-
+
|[[Image:SVN_yellow.jpg|Conflict SVN tag]]
+
|Conflicts with original script you need to search for the <<<<<<mine> and >>>>>>><mine> to see what parts are conflicting and change accordingly.
+
|-
+
|[[Image:SVN_green.jpg|Unmodified SVN tag]]
+
|No changes with original script have been made.
+
|-
+
|style="white-space:nowrap;"|[[Image:SVN_-.jpg|Generated SVN tag]] or [[Image:SVN_q.jpg|New SVN tag]]
+
|Files you added yourself that weren't in the original repository.
+
|}
+
 
+
===Obtain/Install Subversion===
+
Please see the [[:Category:Installation]] appropriate category for installation of Subversion on your operating system of choice and how to utilize it.
+
  
 
==Hercules Git Details==
 
==Hercules Git Details==
 
You can find the root or index of the Hercules source code at the following link: <code>{{git||full}}</code>. This link can be used if you need to view a single file and don't want to dig up your "copy" of the source code.
 
You can find the root or index of the Hercules source code at the following link: <code>{{git||full}}</code>. This link can be used if you need to view a single file and don't want to dig up your "copy" of the source code.
 
===Hercules Trunk===
 
'''Hercules Trunk''' is used as the ''testing'' or otherwise development code. It has all of the latest features, but is not guaranteed to be bug or problem free.
 
 
You can checkout the trunk branch from the following link:
 
<code>{{git|trunk/}}</code>
 
  
 
===Hercules Developer Branches===
 
===Hercules Developer Branches===
Each developer that contributes to the Hercules Project is welcome to their own folder on the SVN, where they may make their own branch. A lot of times, this separate branch is a testing bed for a new feature. You should never assume that any branch that is not trunk or not stable is usable. Often times, it is not.
+
Each developer that contributes to the Hercules Project is welcome to their own branches on the git repository. A lot of times, these separate branches branch are a testing bed for a new feature. You should never assume that any branch that is not trunk or not stable is usable. Often times, it is not.
  
 
==Using .diff/.patch files==
 
==Using .diff/.patch files==
 
{{EntirePage|Diff}}
 
{{EntirePage|Diff}}
Often times, developers and contributors will release their work with a .diff or .patch file. these files are designed specifically to be applied to an SVN revision and 'patched' in.
+
Often times, developers and contributors will release their work with a .diff or .patch file. these files are designed specifically to be applied to Hercules and 'patched' in.  
 
+
In Windows, you can apply a diff or patch file by placing the diff file into the SVN directory, right clicking the diff or patch file, navigating to the Subversion menu and clicking 'Apply Patch'.
+
  
 
If the revision numbers are different, or the code is different in anyway, the patch will likely fail with the error message that the revision numbers do not match. The diff file will include some important symbols and numbers to help you apply them manually.
 
If the revision numbers are different, or the code is different in anyway, the patch will likely fail with the error message that the revision numbers do not match. The diff file will include some important symbols and numbers to help you apply them manually.

Latest revision as of 11:45, 25 April 2016

Contents

Preface

This article will cover the Git details related to Hercules. Git is a version control system that allows multiple users to contribute to the development of Hercules, if permitted. It is also the most efficient method to downloading the source code of Hercules.

About Git

As mentioned above Git is a version control system that allows users to download the latest source code.

Checkout

When you clone a git repository, it is downloaded, along with all history, properties and files, onto your machine so you can make local changes or use it in a production environment.

Commit

When you commit a piece of code, you are saving a set of changes in a form that can be uploaded back to the server. Each commit includes the author's name, what they changed and when they changed it, which can be viewed and referenced later.

Push

When you push your commits, you are sending your commits to the central git server, to make them available to other people.

Only members of the Hercules development team can commit code straight to the Hercules Git.

Pull

When you pull commits, you are downloading the latest commits that were pushed to the git repository, and merging them to your working copy. In this operation, many files are changed, but some are added, deleted or moved. When you pull changes, a lot of conflicts can happen, so keep an eye out of those.

Obtain/Install Git

Please see the Category:Installation appropriate category for installation of Git on your operating system of choice and how to utilize it.

Hercules Git Details

You can find the root or index of the Hercules source code at the following link: https://github.com/HerculesWS/Hercules/blob/master/. This link can be used if you need to view a single file and don't want to dig up your "copy" of the source code.

Hercules Developer Branches

Each developer that contributes to the Hercules Project is welcome to their own branches on the git repository. A lot of times, these separate branches branch are a testing bed for a new feature. You should never assume that any branch that is not trunk or not stable is usable. Often times, it is not.

Using .diff/.patch files

For the entire article, see Diff.

Often times, developers and contributors will release their work with a .diff or .patch file. these files are designed specifically to be applied to Hercules and 'patched' in.

If the revision numbers are different, or the code is different in anyway, the patch will likely fail with the error message that the revision numbers do not match. The diff file will include some important symbols and numbers to help you apply them manually.

/path/to/file [Revision 233]
@@ +241,4 -241,4 @@
+ This line will be added at the line number or position indicated above.
- This line will be removed at the line number or position indicated above.

So in the file, we're to remove line 241 and replace it with the line that has the '+' next to it.