Book Image

Gitlab Cookbook

By : Jeroen van Baarsen
Book Image

Gitlab Cookbook

By: Jeroen van Baarsen

Overview of this book

Table of Contents (16 chapters)
GitLab Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

How to fork a project and what is forking?


When working with a team on a project, you might not want everyone to push to the main source of the project. You'd rather have everyone create their own copy of the project, commit to their project, and ask whether their code can be merged to the main source of the project.

All this can be achieved by forking a project. You can fork a project in GitLab by going to the project and clicking on the Fork button. This will create a copy of the project in your own namespace. You're allowed to do whatever you want with this copy as it's is your own. When you want to push code you created back to the main source, you can create a merge request from your fork back to the main source.

Let's put this in some simple steps:

  1. Go to the project you want to fork.

  2. In the top-right corner, you see a link called Fork. Click on it.

  3. GitLab will show you a notice that the project was successfully cloned.

You can now clone this project to your computer and make changes to it. After you're finished with these changes, you can push the code to this fork and create a merge request, just like we did in Chapter 4, Issue Tracker and Wiki.