Working with git and github/nl: Difference between revisions

From Joomla! Documentation

FuzzyBot (talk | contribs)
Updating to match new version of source page
No edit summary
Line 7: Line 7:
== Wat zijn Git en GitHub ==
== Wat zijn Git en GitHub ==


Git is een gedistribueerd versiebeheersysteem. Het is een systeem die wijzigingen in bestanden registreert en deze wijzigingen ook in de geschiedenis op slaat.
Git is a distributed version control system. It is a system that records changes in files and keeps these changes in a history file. You can always look back to an earlier version of your code and restore changes if you like. Because of the history archive, Git is very useful when you work with many people together on the same project.


Op dit moment kan GitHub gebruikt worden. [https://www.github.com GitHub] is een website die bij het beheren van Gitprojecten op een visuele manier helpt. Als een eigenaar van een project kan je de code wijzigen en vergelijken met verschillende versies. Als een gebruiker van een project kunt u door het maken van een Pull Request een bijdrage leveren. Een Pull Request is een verzoek om wat code in het project te plaatsen. U biedt een stuk code aan wat de oplossing voor een bug kan zijn bijvoorbeeld, en hiermee vraagt u de projecteigenaar of deze de code wilt gebruiken. Als de eigenaar het wil kan hij deze code samenvoegen (merge) aan zijn project.
Here is how GitHub can be used. [https://www.github.com GitHub] is an website that helps manage Git Projects in a visual way. As owner of a project you can change the code and compare different versions. As a user of the project you can contribute by making a Pull Requests. A pull request is a request to the owner to pull some code into the project. You're offering a piece of code (perhaps a solution for a bug) and asking if the Project owner would like to use it. If the owner likes it, he can merge (add) it to his project.


Joomla! gebruikt GitHub en Git om zijn code te beheren. Op deze wijze kan iedereen die het wil bijdragen aan Joomla! De URL naar het Joomla! CMS Project op GitHub is: https://github.com/joomla/joomla-cms
Joomla! uses GitHub and Git to maintain its code. Everyone can contribute Joomla! software. The URL to the Joomla! CMS Project on GitHub is: https://github.com/joomla/joomla-cms




Line 64: Line 64:


== Installeer Joomla! ==
== Installeer Joomla! ==
De installatie van Joomla! op onze locale testinstallatie is bijna hetzelfde als de reguliere installatie. Er zijn twee kleine verschillen.
The installation of Joomla! for our local test installation is almost the same as a regular installation. There are a two little differences.


Bij de database-instellingen zijn de gebruikersnaam en wachtwoord standaard. Dus meestal is de gebruikersnaam <tt>root</tt> en het wachtwoord is ook <tt>root</tt> of er is geen wachtwoord. Als u nog steeds de database niet kan bereiken dan kunt u in de handleiding van uw local server kijken voor de gebruikersnaam en wachtwoord.
For the database settings, the password and username are default. Most often the username is <tt>root</tt> and the password is also <tt>root</tt> or there is no password. If you still can't connect to the database, look in the manual for your local Webserver for the username and password.


Het laatste verschil is de laatste stap van de installatie. Normaal moeten we de installation-map verwijderen om verder te gaan naar de backend of frontend van onze website. Voor de testinstallatie kunnen we dit overslaan en kunnen we direct naar de backend of frontend gaan. Het niet verwijderen van de installation-map kan erg nuttig zijn bij het opnieuw installeren van Joomla!
The last difference is the final step of the installation. Normally we must delete the installation folder to go further to the back-end or front-end of Joomla!. For a test installation we can skip this part, and we can directly go the back-end or front-end. Don't remove the installation folder. It can be very useful when we have to install Joomla again.




=Maak uw wijzigingen=
=Make Your Changes=
Nu is het tijd om ons Joomla! bestand te wijzigen. Alle wijzigingen die gemaakt worden zullen worden geregistreerd door Git. Op elk moment kunt u via de commando <tt>git status</tt> zien welke bestanden gewijzigd zijn en welke niet worden "Untracked" (gemonitord). "Untracked" betekent dat het bestand op de locatie nieuw is voor Git.
Now it is time to made our file changes to Joomla!. All changes we make will be registered and monitored by Git. At any moment you can type the command <tt>git status</tt> to see which files are modified or untracked. Untracked means that the file at that location is new for Git.


Als u een vergissing maakt of graag een bestand wilt herstellen kunt u dit commando gebruiken:
Als u een vergissing heeft gemaakt of een bestand wilt herstellen, kunt u dit commando gebruiken:


<source>
<source>
Line 80: Line 80:
</source>
</source>


Als u de wijzigingen die u hebt gemaakt wilt verwijderen dan kan u de volgende commando gebruiken:
If you like to remove all changes you made, use the following commands:


<source>
<source>
Line 87: Line 87:
</source>
</source>


De eerste commando reset alle bestanden en de tweede verwijderd alle "untracked" bestanden en mappen.
The first command resets all files. The second command removes untracked files and folders.


==Onze wijzigingen publiceren op GitHub==
==Onze wijzigingen publiceren op GitHub==


="Push" de wijziging naar onze "fork"=
=Push the Change to the Fork=
Nadat alle wijzigingen gemaakt zijn kunnen we onze wijzigingen uploaden naar onze "repository" op GitHub. Hierna kunnen we een "pull request" maken met onze wijzigingen.
After making our changes, we have to upload our changes to our repository on GitHub. After that, we can make a pull request with our changes.


Het uploaden van de wijzigingen heet <tt>"push"</tt> in Git terminologie. Maar voordat we dat kunnen doen moeten we eerst iets anders belangrijks doen. We moeten een nieuwe "branch" aanmaken voor onze wijzigingen. (Een "branche" is een versie van ons project, weet u nog?) als we dit niet doen en we maken onze wijziging direct in de "staging branch" dan zal de eerste keer daar geen probleem mee zijn. Maar wanneer we wijzigingen voor de tweede keer maken en eerste wijzigingen zijn nog niet "gemerged" zullen die wijzigingen ook als nieuwe wijzigingen beschouwd worden.
Uploading changes is called <tt>push</tt> in Git terms. Before we can do that, we have to do something very important. We must create a new branch for our changes. (A branch is a version of our project, remember?) If we don't do that and made our change directly to the staging branch, the first time there won't be a problem. But if we made changes for the second time, and the change we made the first time are not merged yet, all these changes will registered too as new changes.


Dus onze eerste commando die we uitvoeren is het creeëren van een nieuwe "branche" om dit te voorkomen.  
So the first command we are going to run will create a new branch. It will prevent the above described problem.
Vervang "name-new-branche"  met de naam van uw nieuwe "branche". Deze naam moet kort zijn en kan alleen kleine letters en getallen bevatten en hebben '''GEEN''' spaties. In plaats van spaties kan de - (minus) gebruikt worden.
Replace name-new-branch with the name of the new branch. This name must be short, and can only contain lower case letters and numbers. Do '''NOT''' use spaces. Instead of spaces, use - (minus).


<source>
<source>
Line 109: Line 109:
</source>
</source>


Het volgende commando voegt onze wijziging toe aan de "branche". Vervang dit bericht met een korte beschrijving van de wijzigingen die gemaakt zijn. Deze beschrijving zal de titel zijn van de "pull request" die we gaan maken.
The following command adds our change to the branch. Please replace the message with a short description of your changes. This description will be the title of the pull request we are going to make.


<source>
<source>
Line 115: Line 115:
</source>
</source>


Het laatste commando zla de wijzigingen uploaden ("push") naar onze "fork" Pas de name-new-branche- aan naar de naam van de "branche" die je een paar stappen eerder gekozen hebt.
The final command will push (upload) the changes to our fork. Please replace name-new-branch with the name of the branch you made a few steps above.


<source>
<source>
Line 121: Line 121:
</source>
</source>


==Vergelijk "forks" en maak een "pull request"==
==Compare Forks and Make a Pull Request==
Nadat onze wijziging ge"pusht" is naar GitHub kan u naar uw Joomla! CMS "fork" gaan.
Nadat onze wijziging ge"pusht" is naar GitHub kan u naar uw Joomla! CMS "fork" gaan.



Revision as of 12:27, 6 January 2016

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 MartijnM (talk| contribs) 10 years ago. (Purge)

Introductie

Dit document geeft informatie over het bijdragen aan het Joomla! CMS met behulp van Git en Github. Als u graag op een eenvoudige wijziging (op een enkel bestand) wilt doen is het beter om deze documentatie te raadplegen: De Github UI gebruiken om een Pull Request in te dienen Als u meer complexe wijzigingen wilt doorvoeren of geïnteresseerd bent, lees dan vooral door!

Wat zijn Git en GitHub

Git is a distributed version control system. It is a system that records changes in files and keeps these changes in a history file. You can always look back to an earlier version of your code and restore changes if you like. Because of the history archive, Git is very useful when you work with many people together on the same project.

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

Joomla! uses GitHub and Git to maintain its code. Everyone can contribute Joomla! software. The URL to the Joomla! CMS Project on GitHub is: https://github.com/joomla/joomla-cms


Aan de slag

Aanmelden op GitHub en Git installeren

Als eerste moet je op GitHub registreren. Het is gratis en erg makkelijk, volg de opgegeven stappen.

Nu u aangemeld bent kunt u Git installeren. De laatste versie van Git kan gevonden worden op http://git-scm.com. Download en start het installatiebestand. Git is een CLI programma, CLI staat voor Command Line Interface. In het begin kan dit verwarrend en onwennig zijn. Er is geen noodzaak hiervoor, dit document zal u door het gehele proces heen leiden.

Als u niet een geavanceerde gebruiker bent kan je gewoon het installatiebestand starten en druk op de "Volgende" knop totdat het programma gaat installeren. Git zal uw systeem niet schaden en je kan deze later verwijderen zoals u dat met andere programma's ook kan doen.

Zodra we Git hebben geïnstalleerd kunnen we het programma genaamd "Git Bash" starten en er zal een commandoregel geopend worden. We gaan Git onze naam en emailadres opgeven. Git zal deze gegevens gebruiken wanneer we een bijdrage leveren aan een project. Met de volgende commandos kunnen we Git deze gegevens geven±

git config --global user.name "Your name"
git config --global user.email youremail@mail.com

In de bovenstaande commandos, en bij alle overige commandos die in deze documentatie staat, zal een nieuwe regel een nieuw commando zijn. Dus je typt de eerste regel, drukt op enter en begint met de tweede regel en drukt weer op enter.

We zijn nu klaar om Git te gebruiken en gaan verder met het instellen van onze testinstallatie.

Instellen van de testinstallatie

Voor onze testinstallatie hebben we een programma nodig die een webserver kan simuleren. Dit zodat we Joomla op uw computer kunnen installeren. Er zijn verschillende programma's die dit kunnen verzorgen. Bijvoorbeeld [1] of [2]. Download en installeer één van deze programma's.

Na de installatie van een programma als dat (in dit voorbeeld wordt MAMP gebruikt) kunnen we de laatste versie van Joomla! installeren. In ons geval is de laatste versie van Joomla! niet de stabiele versie. De laatste versie van Joomla! is de "staging branche" op GitHub. We gaan eerst GitHub wat beter uitleggen.

"Fork" en kloon Joomla!

Op GitHub kan je verschillende projecten vinden, de zogenaamde "Repositories". In een project kunnen er verschillende versies zijn, zo'n versie heet een "branch". Joomla! heeft de volgende "branches":

  • "'Staging:"' Deze "branch" bevat de laatste bugfixes en nieuwe features van Joomla!
  • "'Master:"' Deze branche is de huidige stabiele versie van Joomla!
  • "'3.5-dev"' Deze branche bevat de bestanden voor Joomla! 3.5 die op moment van schrijven nog niet de stabiele versie is.

Op onze testlocatie gaan we de Staging "branche" gebruiken. Maar als we deze "branche" direct gaan gebruiken dan hebben we een probleem. We kunnen deze "branche" niet aanpassen omdat we niet de eigenaar zijn. Wat we gaan doen is dat we een kopie gaan maken, op GitHub heet dit een "Fork". Hier zijn we dan wel de eigenaar van en kunnen dus wijzigingen doorvoeren, en na deze wijzigingen kunnen we onze "Fork" vergelijken met het originele project. Op dat moment kunnen we een "Pull Request" aanmaken voor de wijzigingen die we hebben gemaakt. Daarover later meer in deze documentatie. U kan van een "branche" een "Fork" aanmaken door op de "Fork" knop te drukken op de Joomla! CMS Github Repository. Deze knop bevindt zich aan de rechter bovenkant van de pagina.

Nadat we de "Fork" hebben aangemaakt kunnen we Joomla! op onze locale server installeren. Ga naar de map waar u de bestanden van de webserver kan uitvoeren. De meeste programma's gebruiken een map als htdocs. Zodra we in deze map zitten, klik op de rechtermuis toets en klik op: "Git Bash Here". De command line zal openen op deze locatie.

Typ de volgende opdracht om de bestanden van de "Fork" van het Joomla! CMS op uw computer te downloaden. Vervang Gebruikersnaam met de gebruikersnaam die u gebruikt op GitHub.

git clone https://github.com/username/joomla-cms.git

U zal Git moeten openen via de bovenstaande beschreven stappen om alle commando's uit te voeren die in deze documentatie worden gegeven. Onthoudt dat voor alle andere commando's in deze documentatie.

Als Git klaar is kunt u de browser starten en naar de installatie op uw localhost gaan. Meestal is de URL iets als: http://localhost/joomla-cms. U zult nu een standaard Joomla! installatie zien.

Installeer Joomla!

The installation of Joomla! for our local test installation is almost the same as a regular installation. There are a two little differences.

For the database settings, the password and username are default. Most often the username is root and the password is also root or there is no password. If you still can't connect to the database, look in the manual for your local Webserver for the username and password.

The last difference is the final step of the installation. Normally we must delete the installation folder to go further to the back-end or front-end of Joomla!. For a test installation we can skip this part, and we can directly go the back-end or front-end. Don't remove the installation folder. It can be very useful when we have to install Joomla again.


Make Your Changes

Now it is time to made our file changes to Joomla!. All changes we make will be registered and monitored by Git. At any moment you can type the command git status to see which files are modified or untracked. Untracked means that the file at that location is new for Git.

Als u een vergissing heeft gemaakt of een bestand wilt herstellen, kunt u dit commando gebruiken:

git checkout path/to/file

If you like to remove all changes you made, use the following commands:

git checkout .
git clean -f -d

The first command resets all files. The second command removes untracked files and folders.

Onze wijzigingen publiceren op GitHub

Push the Change to the Fork

After making our changes, we have to upload our changes to our repository on GitHub. After that, we can make a pull request with our changes.

Uploading changes is called push in Git terms. Before we can do that, we have to do something very important. We must create a new branch for our changes. (A branch is a version of our project, remember?) If we don't do that and made our change directly to the staging branch, the first time there won't be a problem. But if we made changes for the second time, and the change we made the first time are not merged yet, all these changes will registered too as new changes.

So the first command we are going to run will create a new branch. It will prevent the above described problem. Replace name-new-branch with the name of the new branch. This name must be short, and can only contain lower case letters and numbers. Do NOT use spaces. Instead of spaces, use - (minus).

git checkout -b name-new-branch

De volgende commando verteld git dat alle wijzigingen goed zijn en klaar staan om te worden "commit".

git add --all

The following command adds our change to the branch. Please replace the message with a short description of your changes. This description will be the title of the pull request we are going to make.

git commit -m "description"

The final command will push (upload) the changes to our fork. Please replace name-new-branch with the name of the branch you made a few steps above.

git push origin name-new-branch

Compare Forks and Make a Pull Request

Nadat onze wijziging ge"pusht" is naar GitHub kan u naar uw Joomla! CMS "fork" gaan.

Meer informatie

Omdat de "staging' versie van Joomla! op elk moment kan wijzigen is het erg nuttig om de mogelijkheid te hebben om onze "fork" up-to-date te kunnen houden. We kunnen dit doen door een "remote" toe te voegen aan onze project "fork".

git remote add upstream https://github.com/joomla/joomla-cms.git

We hebben nu een "remote" genaamd "upstream" toegevoegd. Met het volgende commando kunnen we Git laten zoeken naar nieuwe "commits" in de "staging branch" die we niet in onze "fork" hebben.

git pull upstream staging

De wijzigingen zijn nu alleen in onze lokale "fork" gemaakt. We kunnen ze met het volgende commando naar GitHub uploaden:

git push


Categorie: Bug Squad/nl Bug Squad Categorie: Ontwikkeling/nl Ontwikkeling Categorie:GitHub/nl GitHub