Skip to content

Commit fd6e73a

Browse files
committed
Added TortoiseGit contribution docs.
Revised Command-Line contribution docs. Signed-off-by: Jakobud <jake.e.wilson@gmail.com>
1 parent 72d091e commit fd6e73a

File tree

3 files changed

+135
-13
lines changed

3 files changed

+135
-13
lines changed

laravel/documentation/contrib/command-line.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Command Line
1+
# Contributing to Laravel via Command-Line
22

33
## Contents
44
- [Getting Started](#getting-started)
55
- [Forking Laravel](#forking-laravel)
66
- [Cloning Laravel](#cloning-laravel)
7+
- [Adding your Fork](#adding-your-fork)
78
- [Creating Branches](#creating-branches)
89
- [Committing](#committing)
910
- [Submitting a Pull Request](#submitting-a-pull-request)
@@ -12,11 +13,9 @@
1213
<a name='getting-started'></a>
1314
## Getting Started
1415

15-
This tutorial explains the basics of contributing to a project on [GitHub](https://github.com/). The workflow can apply to most projects on GitHub, but in this case, we will be focused on the [Laravel](https://github.com/laravel/laravel) project.
16+
This tutorial explains the basics of contributing to a project on [GitHub](https://github.com/) via the command-line. The workflow can apply to most projects on GitHub, but in this case, we will be focused on the [Laravel](https://github.com/laravel/laravel) project. This tutorial is applicable to OSX, Linux and Windows.
1617

17-
This tutorial assumes that you have installed [Git](http://git-scm.com/) and that you have created a [GitHub account](https://github.com/signup/free). If you haven't already, look at the documentation for [Laravel on GitHub](/docs/contrib/github) in order to familiarize yourself with Laravel's repositories and branches.
18-
19-
*[Jason Lewis](http://jasonlewis.me/)'s blog post on [Contributing to a GitHub Project](http://jasonlewis.me/blog/2012/06/how-to-contributing-to-a-github-project) was the inspiration for this tutorial.*
18+
This tutorial assumes you have installed [Git](http://git-scm.com/) and you have created a [GitHub account](https://github.com/signup/free). If you haven't already, look at the [Laravel on GitHub](/docs/contrib/github) documentation in order to familiarize yourself with Laravel's repositories and branches.
2019

2120
<a name='forking-laravel'></a>
2221
## Forking Laravel
@@ -35,13 +34,16 @@ Next, clone the Laravel repository (not your fork you made):
3534

3635
# git clone https://github.com/laravel/laravel.git .
3736

38-
The reason you are cloning the original Laravel repository (and not the fork you made) is so you can use it to always have the latest Laravel development code. If you simply clone the fork you made, you would have to re-fork the Laravel repository again every time you want the latest changes to Laravel development code.
37+
> **Note**: The reason you are cloning the original Laravel repository (and not the fork you made) is so you can always pull down the most recent changes from the Laravel repository to your local repository.
38+
39+
<a name='adding-your-fork'></a>
40+
## Adding your Fork
3941

4042
Next, it's time to add the fork you made as a **remote repository**:
4143

4244
# git remote add fork git@github.com:username/laravel.git
4345

44-
Remember to replace **username** with your GitHub username. *This is case-sensitive*. You can verify that your fork was added by typing:
46+
Remember to replace *username** with your GitHub username. *This is case-sensitive*. You can verify that your fork was added by typing:
4547

4648
# git remote
4749

@@ -58,22 +60,20 @@ Next, you want to make sure you are up-to-date with the latest Laravel repositor
5860

5961
# git pull origin develop
6062

61-
Now you are ready to create a new branch.
62-
63-
> **Create a new branch for every new feature or bug-fix.** Why? Let's say you make a new branch and add 5 different new features and fix 12 bugs. If one or more of your new features or bug-fixes are rejected by the Laravel team (for whatever reason) your entire pull request will be ignored, even if most of your new features or bug-fixes are perfect. On top of this, separate branches will encourage organization and limit interdependency between new features and bug-fixes that you add.
64-
65-
When you create a new branch, use a self-descriptive naming convention. For example, if there is a bug in Eloquent that you want to fix, name your branch accordingly:
63+
Now you are ready to create a new branch for your new feature or bug-fix. When you create a new branch, use a self-descriptive naming convention. For example, if you are going to fix a bug in Eloquent, name your branch *bug/eloquent*:
6664

6765
# git branch bug/eloquent
6866
# git checkout bug/eloquent
6967
Switched to branch 'bug/eloquent'
7068

71-
Or if there is a new feature or change to the documentation that you want to make, for example, the localization documentation:
69+
Or if there is a new feature to add or change to the documentation that you want to make, for example, the localization documentation:
7270

7371
# git branch feature/localization-docs
7472
# git checkout feature/localization-docs
7573
Switched to branch 'feature/localization-docs'
7674

75+
> **Note:** Create one new branch for every new feature or bug-fix. This will encourage organization, limit interdependency between new features/fixes and will make it easy for the Laravel team to merge your changes into the Laravel core.
76+
7777
Now that you have created your own branch and have switched to it, it's time to make your changes to the code. Add your new feature or fix that bug.
7878

7979
<a name='committing'></a>
@@ -97,6 +97,8 @@ Now that your local repository has your committed changes, it's time to push (or
9797

9898
# git push fork feature/localization-docs
9999

100+
Your branch has been successfully pushed to your fork on GitHub.
101+
100102
<a name='submitting-a-pull-request'></a>
101103
## Submitting a Pull Request
102104

@@ -121,3 +123,5 @@ Then, pull down the latest changes from Laravel's repository:
121123
# git pull origin develop
122124

123125
Now you are ready to create a new branch and start coding again!
126+
127+
> [Jason Lewis](http://jasonlewis.me/)'s blog post [Contributing to a GitHub Project](http://jasonlewis.me/blog/2012/06/how-to-contributing-to-a-github-project) was the primary inspiration for this tutorial.

laravel/documentation/contrib/github.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ The **laravel** repository has multiple branches, each serving a specific purpos
2828
- **develop** - This is the working development branch. All proposed code changes and contributions by the community are pulled into this branch. *When you make a pull request to the Laravel project, this is the branch you want to pull-request into.*
2929

3030
Once certain milestones have been reached and/or Taylor Otwell and the Laravel team is happy with the stability and additional features of the current development branch, the changes in the **develop** branch are pulled into the **master** branch, thus creating and releasing the newest stable version of Laravel for the world to use.
31+
32+
*Further Reading*
33+
34+
- [Contributing to Laravel via Command-Line](docs/contrib/command-line)
35+
- [Contributing to Laravel using TortoiseGit](docs/contrib/tortoisegit)
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Contributing to Laravel using TortoiseGit
2+
3+
## Contents
4+
- [Getting Started](#getting-started)
5+
- [Forking Laravel](#forking-laravel)
6+
- [Cloning Laravel](#cloning-laravel)
7+
- [Adding your Fork](#adding-your-fork)
8+
- [Creating Branches](#creating-branches)
9+
- [Committing](#committing)
10+
- [Submitting a Pull Request](#submitting-a-pull-request)
11+
- [What's Next?](#whats-next)
12+
13+
<a name='getting-started'></a>
14+
## Getting Started
15+
16+
This tutorial explains the basics of contributing to a project on [GitHub](https://github.com/) using [TortoiseGit](http://code.google.com/p/tortoisegit/) for Windows. The workflow can apply to most projects on GitHub, but in this case, we will be focused on the [Laravel](https://github.com/laravel/laravel) project.
17+
18+
This tutorial assumes you have installed TortoiseGit for Windows and you have created a GitHub account. If you haven't already, look at the [Laravel on GitHub](/docs/contrib/github) documentation in order to familiarize yourself with Laravel's repositories and branches.
19+
20+
<a name='forking-laravel'></a>
21+
## Forking Laravel
22+
23+
Login to GitHub and visit the [Laravel Repository](https://github.com/laravel/laravel). Click on the **Fork** button. This will create your own fork of Laravel in your own GitHub account. Your Laravel fork will be located at **https://github.com/username/laravel** (your GitHub username will be used in place of *username*).
24+
25+
<a name='cloning-laravel'></a>
26+
## Cloning Laravel
27+
28+
Open up Windows Explorer and create a new directory where you can make development changes to Laravel.
29+
30+
- Right-click the Laravel directory to bring up the context menu. Click on **Git Clone...**
31+
- Git clone
32+
- **Url:** https://github.com/laravel/laravel.git
33+
- **Directory:** the directory that you just created in the previous step
34+
- Click **OK**
35+
36+
> **Note**: The reason you are cloning the original Laravel repository (and not the fork you made) is so you can always pull down the most recent changes from the Laravel repository to your local repository.
37+
38+
<a name='adding-your-fork'></a>
39+
## Adding your Fork
40+
41+
After the cloning process is complete, it's time to add the fork you made as a **remote repository**.
42+
43+
- Right-click the Laravel directory and goto **TortoiseGit > Settings**
44+
- Goto the **Git/Remote** section. Add a new remote:
45+
- **Remote**: fork
46+
- **URL**: https://github.com/username/laravel.git
47+
- Click **Add New/Save**
48+
- Click **OK**
49+
50+
Remember to replace *username* with your GitHub username. *This is case-sensitive*.
51+
52+
<a name='creating-branches'></a>
53+
## Creating Branches
54+
55+
Now you are ready to create a new branch for your new feature or bug-fix. When you create a new branch, use a self-descriptive naming convention. For example, if you are going to fix a bug in Eloquent, name your branch *bug/eloquent*. Or if you were going to make changes to the localization documentation, name your branch *feature/localization-docs*. A good naming convention will encourage organization and help others understand the purpose of your branch.
56+
57+
- Right-click the Laravel directory and goto **TortoiseGit > Create Branch**
58+
- **Branch:** feature/localization-docs
59+
- **Base On Branch:** remotes/origin/develop
60+
- **Check** *Track*
61+
- **Check** *Switch to new branch*
62+
- Click **OK**
63+
64+
This will create your new *feature/localization-docs* branch and switch you to it.
65+
66+
> **Note:** Create one new branch for every new feature or bug-fix. This will encourage organization, limit interdependency between new features/fixes and will make it easy for the Laravel team to merge your changes into the Laravel core.
67+
68+
Now that you have created your own branch and have switched to it, it's time to make your changes to the code. Add your new feature or fix that bug.
69+
70+
<a name='committing'></a>
71+
##Committing
72+
73+
Now that you have finished coding and testing your changes, it's time to commit them to your local repository:
74+
75+
- Right-click the Laravel directory and goto **Git Commit -> "feature/localization-docs"...**
76+
- Commit
77+
- **Message:** Provide a brief explaination of what you added or changed
78+
- Click **Sign** - This tells the Laravel team know that you personally agree to your code being added to the Laravel core
79+
- **Changes made:** Check all changed/added files
80+
- Click **OK**
81+
82+
<a name='pushing-to-your-fork'></a>
83+
## Pushing to your Fork
84+
85+
Now that your local repository has your committed changes, it's time to push (or sync) your new branch to your fork that is hosted in GitHub:
86+
87+
- Right-click the Laravel directory and goto **Git Sync...**
88+
- Git Syncronization
89+
- **Local Branch:** feature/localization-docs
90+
- **Remote Branch:** leave this blank
91+
- **Remote URL:** fork
92+
- Click **Push**
93+
- When asked for "username:" enter your GitHub *case-sensitive* username
94+
- When asked for "password:" enter your GitHub *case-sensitive* account
95+
96+
Your branch has been successfully pushed to your fork on GitHub.
97+
98+
<a name='submitting-a-pull-request'></a>
99+
## Submitting a Pull Request
100+
101+
The final step is to submit a pull request to the Laravel repository. This means that you are requesting that the Laravel team pull and merge your changes to the Laravel core. In your browser, visit your Laravel fork at [https://github.com/username/laravel](https://github.com/username/laravel). Click on **Pull Request**. Next, make sure you choose the proper base and head repositories and branches:
102+
103+
- **base repo:** laravel/laravel
104+
- **base branch:** develop
105+
- **head repo:** username/laravel
106+
- **head branch:** feature/localization-docs
107+
108+
Use the form to write a more detailed description of the changes you made and why you made them. Finally, click **Send pull request**. That's it! The changes you made have been submitted to the Laravel team.
109+
110+
<a name='whats-next'></a>
111+
## What's Next?
112+
113+
Do you have another feature you want to add or another bug you need to fix? Just follow the same instructions as before in the [Creating Branches](#creating-branches) section. Just remember to always create a new branch for every new feature/fix and don't forget to always base your new branches off of the *remotes/origin/develop* branch.

0 commit comments

Comments
 (0)