Skip to content

Fork & Edit on Github

JuanMa Garrido edited this page Apr 2, 2020 · 10 revisions

With this workflow you can create a copy (called a fork) of the gitbook-docs under your profile which you can use to propose changes in any of the files.

This fork is connected to the official repo so all the changes you do in this fork can be used to create a Pull Request to the official repo.

1. Create a fork

From the official documentation repository click the Fork button.

create-fork

After the fork process is completed you'll see the fork under your github profile.

fork

2. Open and edit the documents in the online file editor

Locate the file that you want to change in your fork and open it in the online file editor by clicking the button with the pencil icon.

github-edit-button

On the Edit file tab, make any changes you want to make to the file. (Remember that changes should be made using Markdown)

github-edit-tab

4. Commit your changes

For changes in each file to be submitted, you have to commit your changes. Every commit should have a message describing your changes (Removed unnecesary asterisks in our example).

In order to simplify things you can use the master branch of your fork to commit your changes (but you could use another branch if you wish).

commit-changes

Click "Commit changes".

You can repeat this operation for any other file in the documentation. Remember to commit your changes to the same branch (master in our example).

Once you've finished editing files (with your suggestions) you can create a Pull Request for all the changes you've committed.

5. Create Pull Request

Once you've finished editing files in the master branch (of your fork, i.e. your copy of the official documentation) you can submit all these changes for consideration by creating a Pull Request from this master branch.

To do that, go to the main page of your fork repo and click New pull request in the button besides the Branch: master.

create-pull-request

This will take you to the "Compare changes" page where you can see all the changes that will be included in your Pull Request (which will be made to the original official documentation repo).

compare-changes

Notice that here you're comparing the changes in the master branch of your fork (head repository: <your username>/gitbook-docs in our example) against the current status of the master branch of the official repo (base repository: frontity/gitbook-docs).

Click the button "Create pull request" that appears besides the text Discuss and review the changes in this comparison with others.

You'll then see this view:

create-pull-request-detail

Here you can set the title of the pull request (unnecesary characters removed in our example) and add any comments regarding your changes.

Once you've done this... click on "Create pull request"

🎉 Pull Request created

Boom! Your Pull Request has now been created. Now the ball is in our court.

pull-request

Your changes will now have been added to the list of opened pull requests that will be reviewed by the Frontity team.

list-pull-request

We will either accept your changes and merge them with the final version or, if we want to discuss the changes, we will start a conversation about them on the Pull Request.