diff --git a/05-team-collaboration/README.md b/05-team-collaboration/README.md new file mode 100644 index 0000000000000000000000000000000000000000..44423a119d011131487113a1a35b242a0611efba --- /dev/null +++ b/05-team-collaboration/README.md @@ -0,0 +1,34 @@ +# Team Collaboration in GitLab + +## Project Roles + +GitLab has a predefined set of [roles with different permissions](https://docs.gitlab.com/ee/user/permissions.html). To summarize: + + 1. *Project Owner*: the person who created the project. Has all the rights on the project (repository and associated functionality) + 2. Project Maintainer: about the same as the Project Owner, but cannot change or remove the global project settings. + 3. *Developer*: has read access to all the project's content, and can use the repository and the issue related functionalities. + 4. Reporter: has mostly read access to the repository, but can also submit merge requests or issues. + 4. Guest: mainly read access to the repository and othe project pages, but can also submit issues. + +When working on a small-sized project, apart from the owner, the other members will have the developer role. If there is a significant and tech-savvy user community, the can be assigned a reporter role. The project owner (and maintainers) have the permission to manage membership. It is up to them to assign roles to every newly accepted user. + +The project member management page is accessed through the *Members* item of the *Project Information* entry on the left panel. + + + +## Branch Protection + +GitLab allows the project owner to restrict who can push to a branch or delete a branch, using the [branch protection](https://docs.gitlab.com/ee/user/project/protected_branches.html) features. By default, the `master` branch is protected. So only members of the Maintainers group can push or merge into this branch. +For medium to large size projects, it may be useful to protect other branches as well. For small projects, it may be unnecessary to protect the `master` branch. + +Branch protection settings can be accesed from the left panel, using the *Settings* menu and the *Repository* entry and then expanding the `Protected Branches` section. + + + +## Merge Requests + +When working collaboratively on a project, it is recommended not to merge or push to branches on which other people are susceptible to work as well. Instead, when a set of commits has been tested, it is recommended to create a *Merge Request* (or MR). An MR leaves an explicit track in GitLab of a set of modifications, whereas simple commit/push/merge operations quickly become invisible in the project's history. Moreover, an MR can be assigned to another project member, giving him or her the opportunity to review your modifications. If needed, the reviewer can require additionnal comments or even suggest fixes or enhancements. This reviewing process adds a lot of value to the project's code or document base. + +An MR follows the same principle as an ordinary merge, and is defined by a source and a target branch. Managing MRs in GitLab is done with the *Merge Requests* entry of the left panel. + + diff --git a/05-team-collaboration/exercises.md b/05-team-collaboration/exercises.md new file mode 100644 index 0000000000000000000000000000000000000000..b24632eafa2542623717faf26346d299749144c8 --- /dev/null +++ b/05-team-collaboration/exercises.md @@ -0,0 +1,34 @@ +# Team Collaboration in GitLab - Exercises + +## Membership Management + +Use the GitLab membership management tool to add some of your classmates' accounts to your project. + +## Branch Protection + +Use the GitLab repository settings page to unprotect the `master` branch. + +## Merge Requests + +Use the GitLab Web IDE and the project of one of your classmates: + 1. Create a new branch. + 1. Add some contents to the branch. + 1. Commit the changes using an MR. + 1. Assign the Merge Request to the project owner. + +When one of your classmates has submitted an MR to your project: + 1. Review the changes. + 1. Make some comments. + 1. Accept the MR. + + + + + + + + + + + + diff --git a/05-team-collaboration/media/gitlab-branch-protection.png b/05-team-collaboration/media/gitlab-branch-protection.png new file mode 100644 index 0000000000000000000000000000000000000000..4cd19ab08210272e4c23732af03dafeb8caac2d4 Binary files /dev/null and b/05-team-collaboration/media/gitlab-branch-protection.png differ diff --git a/05-team-collaboration/media/gitlab-members.png b/05-team-collaboration/media/gitlab-members.png new file mode 100644 index 0000000000000000000000000000000000000000..2f4842d6b058c873c1b3a00bbbe45dc52199fa46 Binary files /dev/null and b/05-team-collaboration/media/gitlab-members.png differ diff --git a/README.md b/README.md index 3b8c14f50f63776e4648fd01ffd1b20d60229388..7b31af525512d263c9b5da05cdde593fdb72ba40 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,13 @@ Training material for the Git for Beginners ABiMS training session 1. Using GitLab to manage branches 1. Using the CLI to manage branches -### Team collaboration - 1. Project roles in GitLab +### [Team Collaboration in GitLab](./05-team-collaboration/README.md) + 1. Project Roles 1. Branch Protection 1. Submitting Merge Requests 1. Handling Merge Requests -### Using Git through third party tools +### Using Git With Third Party Tools 1. Using Git inside R-Studio 1. Using Git inside PyCharm