Working with git and github: Difference between revisions

From Joomla! Documentation

No edit summary
Line 1: Line 1:
{{underconstruction}}
=Intro=
=Intro=
This document will provide a brief overview of working with the Joomla Platform repository on github.com for people who are interested in making code contributions and using eclipse as an IDE. Much will also apply for people who just want to follow development, but that is much simpler.
This document will provide information about contributing to the Joomla! CMS with help of Git and GitHub. If you like to made a simple change (one file only), it is easier to use this documentation: [[Using the Github UI to Make Pull Requests]]
 
If you like to add more complex changes or you're just interested in this, keep reading!
Some preliminary information.
 
=== What is Git? ===
 
Git is distributed version control software. Such software (another example is Mercurial while subversion and CVS are non distributed version control systems) allow many people to contribute code to a single project and also allow for well defined tracking of code changes and provide mechanisms for recording commit by commit records of changes.
 
=== What is Github? ===
 
Github is a host for git repositories. It is located at [https://github.com github.com]
 
=== What is the Joomla! CMS? ===
 
Joomla is an award-winning content management system (CMS), which enables you to build Web sites and powerful online applications. Many aspects, including its ease-of-use and extensibility, have made Joomla the most popular Web site software available. Best of all, Joomla is an open source solution that is freely available to everyone.
 
[[Portal:Learn_More|Find out more about Joomla...]]


=== What is the Joomla! Platform? ===
=== What are Git and GitHub? ===


The Joomla! Platform also known as the Joomla! Framework is the set of libraries that are used to build the Joomla! CMS and other applications.
Git is a distributed version control system. It is a system that records changes in files, and keep this changes in history. So you can always look back to an earlier version of you're code and restore changes if you like. Because of the history, Git is very useful when you work with many people together on the same project.


The platform is managed separately from the CMS and has its own release cycle; each release of the CMS uses one specific version of the platform.
On this moment GitHub can be used. [https://www.github.com GitHub] is an website, what helps manage Git Projects in a visual way. As owner of a project you can change the code, and compare different versions. As user of the project you can contribute by making an Pull Request. A Pull request is a request to pull some code in that project. You're offering a piece of code, what can be a solution for a bug for example, and asking if the Project owner(s) like to use it. If the owner likes it, he can merge (add) it to his project.


The platform repository is located at: [https://github.com/joomla/joomla-platform  github.com/joomla/joomla-platform]
Joomla! uses GitHub and Git to maintain it's code. So everyone can contribute to Joomla! if they like to.


=Getting Started=
=Getting Started=
=== Setup a Github account ===
=== Sign up on GitHub and install Git ===
First, you will need to register at git hub. 
First, you will need to register at [http://www.github.com GitHub]. It's free and very easy to do, just follow the provided steps.
 
Once registered, you will probably want to go to [https://github.com/joomla/joomla-platform github.com/joomla/joomla-platform ] and click follow. Then whenever you log in you will see the latest things that have happened in the repository.
 
If you are going to code, you will also want to click on fork. This will give you your own copy of the platform to work with. You'll probably want to follow that too.
 
=== Install Git ===
Now you will want to install git on your local workstation. Github provides excellent instructions on how to do this that will detect your operating system. Simply click on the Set Up Git button.
 
You will need to set up SSH. As it says on the Github instructions " Setting them up is fairly easy, but does involve a number of steps." Some will be specific to your operating system, so follow the instructions at github.
 
You will also need to tell Git your user name and password so that it can connect to your repositories on github.
 
=== Methods of Using Git ===
==== Command Line ====
If you like using the command line, git by itself provides commands to create a local copy of your fork at github. There are a number of tutorials and reference sites for git including:
* [http://git-scm.com/documentation  git-scm.com/documentation]
* [http://gitimmersion.com/ gitimmersion]
 
Github itself has many documents about how to use git on its help site
*[http://help.github.com/ help.github.com]
 
==== Using Eclipse ====
For updated information on working with Eclipse and Git, see [[Working with Git and Eclipse]].
 
=Working on Joomla! Code=
== Getting to Work ==
 
Once you have your repository you are ready to start working on code.
Whenever you have some code that you are happy with, you should commit it locally. Note that unless you commit, your local changes will not enter into version control.
To commit, you click Team>commit.
 
=== Creating patches ===
The most painless method seems to be the command line as described on the [http://git-scm.com git home page] as a quick start "Cloning and Creating a Patch"
 
<pre>
$ git clone git://github.com/joomla/joomla-cms.git
$ cd joomla-cms
$ (edit files)
$ git add (files)
$ git commit -m 'Explain what I changed'
$ git format-patch origin/master
</pre>
 
It seems also possible to create patches in eclipse eGit
 
You can also use git-diff to create patches, to create a diff with the latest commit
<pre>
$ git diff --no-prefix ^HEAD
</pre>
 
=Beyond the Basics=
== Further steps ==
 
* [[/My first pull request|How to submit a Pull Request to GitHub]]
 
To be continued ...
{{page|needs content}}
 
== Trouble Shooting ==
 
If you get a message about unpacking try adding .git to the end of the remote repository url.


== Reference ==
One we are signed up, we need to install Git. The latest version of Git can be found on http://git-scm.com. Download and open the installer.


* [http://progit.org/book/ Pro Git]
* [http://www.ndpsoftware.com/git-cheatsheet.html Git Cheatsheet]
<headertabs/>
[[Category: Bug Squad]] [[Category: Development]]
[[Category: Bug Squad]] [[Category: Development]]
[[Category:GitHub]]
[[Category:GitHub]]

Revision as of 07:10, 11 October 2015

Under Construction

This article or section is in the process of an expansion or major restructuring. You are welcome to assist in its construction by editing it as well. If this article or section has not been edited in several days, please remove this template.
This article was last edited by N9iels (talk| contribs) 10 years ago. (Purge)


Intro

This document will provide information about contributing to the Joomla! CMS with help of Git and GitHub. If you like to made a simple change (one file only), it is easier to use this documentation: Using the Github UI to Make Pull Requests If you like to add more complex changes or you're just interested in this, keep reading!

What are Git and GitHub?

Git is a distributed version control system. It is a system that records changes in files, and keep this changes in history. So you can always look back to an earlier version of you're code and restore changes if you like. Because of the history, Git is very useful when you work with many people together on the same project.

On this moment GitHub can be used. GitHub is an website, what helps manage Git Projects in a visual way. As owner of a project you can change the code, and compare different versions. As user of the project you can contribute by making an Pull Request. A Pull request is a request to pull some code in that project. You're offering a piece of code, what can be a solution for a bug for example, and asking if the Project owner(s) like to use it. If the owner likes it, he can merge (add) it to his project.

Joomla! uses GitHub and Git to maintain it's code. So everyone can contribute to Joomla! if they like to.

Getting Started

Sign up on GitHub and install Git

First, you will need to register at GitHub. It's free and very easy to do, just follow the provided steps.

One we are signed up, we need to install Git. The latest version of Git can be found on http://git-scm.com. Download and open the installer.