Commit e409c1ca authored by French, Robert's avatar French, Robert Committed by GitLab
Browse files

Describe what a merge request is

parent 38f2f222
# Dec 22: What is a Merge Request?
**Thursday 12/22, 9:00am in JICS Auditorium (5100 RM 128)**
<!-- $theme: gaia -->
<!-- $size: 16:9 -->
<!-- *template: invert -->
# What is a Merge Request?
## ORNL Git It Together
Merge Requests are the core of collaboration in Gitlab. In this session, we'll
walk through creating a merge request for a shared project, and we'll talk about
some of the issue that come up in accepting and vetting merge requests from
external collaborators
---
Offsite folks can join us via [BlueJeans](https://bluejeans.com/309751285).
<!-- page_number: true -->
## What is a Merge Request?
Merge Requests are the core of collaboration in Gitlab. In this session, we'll:
* walk through creating a merge request for a shared project
* talk about some of the issue that come up in accepting and vetting merge requests from external collaborators
## What is my target branch now?
Gitlab uses the term 'target branch' to mean "The branch **into which** new
changes will be merged". So, if you are using the gitlab interface to edit a
file, you will be able to commit those changes into a new target branch. Later,
if you would like to merge those changes into `master`, then `master` will be
your target branch, and the earlier one will be your source branch.
---
1. Change README.md in master, commit to 'spell-my-name-correctly' target branch
2. Open a merge request with 'spell-my-name-correctly' as the *source* branch, and 'master' as the *target* branch.
3. Merge away!
\ No newline at end of file
### What does the workflow look like?
![Regular Branch Merge](bitbucket_pr_workflow.png)
<small>(Image stolen from [Atlassian's Blog](http://blogs.atlassian.com/2016/11/5-pull-request-must-haves/), which is excellent btw)</small>
---
### What manner of of Gitlab Magic happens during a Merge Request?
**None**. It is a regular merge:
![Regular Branch Merge](regular_branch_merge.png)
<small>(Image stolen from the [Visual Studio Git Documentation](https://www.visualstudio.com/en-us/docs/git/merging-with-squash), which is also excellent)</small>
---
## Interlude: Target Branches
<!-- *template: invert -->
<!-- *page_number: false -->
---
### What is a target branch?
**target branch** - The branch *into which* new changes will be merged.
This is a naming convention that git hosts (Gitlab, Github, etc) use to help clarify the Merge Request process.
So, if you are using the gitlab interface to edit a file, you will be able to commit those changes into a new target branch.
---
### Edit a file in a new target branch
1. Change README.md in master, commit to `spell-my-name-correctly` target branch
2. Open a merge request with `spell-my-name-correctly` as the *source* branch, and `master` as the *target* branch.
#### Pro Tip
* Use the web interface for minor changes, especially when working with a group
---
### Target Branches change relative to your intentions
* If you push to a new branch called `awesome-new-feature`, then that is your target branch.
* Later, if you would like to merge those changes into `master`, then `master` will be your target branch, and `awesome-new-featuress` will be your source branch.
---
## Merge Requests: Working with friends
<!-- *template: invert -->
<!-- *page_number: false -->
---
### Who are my friends?
* Folks who have *at least* "Developer" access to your Project
* Masters, and Owners are also your friends
* Any of these folks can create new branches and push commits to them
---
#### Who ain't my friends?
* Reporters and Guests have fewer prviliges (see next section), and are not your friends
* More info on gitlab roles at [TODO](https://todo.com)
---
## Interactive Example!
<!-- *template: invert -->
<!-- *page_number: false -->
---
### Who put graffiti on my page?
Search the `what-is-a-merge-request/README.md` file for the phrase "graffiti"
* Write whatever you want in the blanks, I'll merge the first one, and let's hope no one's embarassed by what shows up on the screen
* Graffiti by: <!-- your name here! -->
* <!-- write your graffiti here -->
---
### Prevent your friends from wrecking your house
* Projects may (should!) choose to **protect the master branch**
* This prevents folks from pushing arbitrary code to master
* All commits from friends must come through a merge request
* This puts friends on a similar level to guests, but they can still retain some privileges as appropriate for your project.
* Gitlab's Protected branches allow you to mix and match privileges as you see fit!
---
## Questions?
<!-- *template: invert -->
<!-- *page_number: false -->
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment